~ubuntu-branches/ubuntu/wily/afnix/wily

« back to all changes in this revision

Viewing changes to src/lib/eng/shl/Lexical.cpp

  • Committer: Package Import Robot
  • Author(s): Nobuhiro Iwamatsu
  • Date: 2015-07-11 02:00:35 UTC
  • mfrom: (10.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20150711020035-2nhpztq7s15qyc0v
Tags: 2.5.1-1
* New upstream release. (Closes: #789968)
* Update debian/control.
  - Update Standards-Version to 3.9.6.
* Add support mips64(el) and ppc64el. (Closes: #741508, #748146)
* Add patches/support-gcc-5.x.patch. (Closes: #777767)
  - Fix build with gcc-5.x.
* Add patches/Disable-NET0001.als.patch.
  - Disable test of NET0001.als.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
// - the copyright holder be liable for any  direct, indirect, incidental or -
12
12
// - special damages arising in any way out of the use of this software.     -
13
13
// ---------------------------------------------------------------------------
14
 
// - copyright (c) 1999-2012 amaury darsch                                   -
 
14
// - copyright (c) 1999-2015 amaury darsch                                   -
15
15
// ---------------------------------------------------------------------------
16
16
 
17
17
#include "Engsid.hxx"
38
38
    return new Lexical;
39
39
  }
40
40
  // register this lexical serial id
41
 
  static const t_byte SERIAL_ID = Serial::setsid (SERIAL_LEXL_ID, mksob);
 
41
  static const t_byte SERIAL_ID __attribute__((unused)) = Serial::setsid (SERIAL_LEXL_ID, mksob);
42
42
 
43
43
  // -------------------------------------------------------------------------
44
44
  // - public section                                                        -
84
84
  // create a default lexical
85
85
 
86
86
  Lexical::Lexical (void) {
87
 
    d_lnum  = 0;
88
 
    d_quark = 0;
 
87
    d_lnum  = 0L;
 
88
    d_quark = 0L;
89
89
  }
90
90
 
91
91
  // create a lexical with a name
95
95
      throw Exception ("syntax-error","invalid lexical name", name);
96
96
    d_name  = name;
97
97
    d_quark = name.toquark ();
98
 
    d_lnum  = 0;
 
98
    d_lnum  = 0L;
99
99
  }
100
100
 
101
101
  // create a lexical with a name and a line number
136
136
    return new Lexical (*this);
137
137
  }
138
138
 
 
139
  // clear this lexical name
 
140
 
 
141
  void Lexical::clear (void) {
 
142
    wrlock ();
 
143
    try {
 
144
      d_name  = "";
 
145
      d_quark = 0L;
 
146
      d_lnum  = 0L;
 
147
      unlock ();
 
148
    } catch (...) {
 
149
      unlock ();
 
150
      throw;
 
151
    }
 
152
  }
 
153
 
139
154
  // return a literal representation of this lexical
140
155
 
141
156
  String Lexical::toliteral (void) const {
175
190
  void Lexical::wrstream (OutputStream& os) const {
176
191
    rdlock ();
177
192
    try {
178
 
      Integer lnum (d_lnum);
179
193
      d_name.wrstream (os);
180
 
      lnum.wrstream   (os);
 
194
      Serial::wrlong (d_lnum, os);
181
195
      unlock ();
182
196
    } catch (...) {
183
197
      unlock ();
190
204
  void Lexical::rdstream (InputStream& is) {
191
205
    wrlock ();
192
206
    try {
193
 
      String  sval;
194
 
      Integer ival;
195
 
      sval.rdstream (is);
196
 
      ival.rdstream (is);
197
 
      d_name  = sval;
198
 
      d_lnum  = ival.tolong ();
 
207
      String sval; sval.rdstream (is); d_name = sval;
 
208
      d_lnum  = Serial::rdlong (is);
199
209
      d_quark = sval.toquark ();
200
210
      unlock ();
201
211
    } catch (...) {