File gps/Parser


class gps.ParserDefines

variables

const EOF = 0;

instance gps.ParserDefines


class gps.FileElement

Inherits

Behaviour supers
tom.All

instance gps.FileElement

Inherits

Behaviour supers
tom.All

methods

deferred int
  line;
Return the line in the file at which this element was declared (or whatever you call it).

tom.OutputStream
  describeLocation tom.OutputStream s
               for Parser parser;
Describe the location of the receiving file element to the stream s. The default implementation prints the line. The parser may be nil, if there is no current parser.


class gps.Parser

Inherits

State supers
tom.State, tom.stdio

variables

static tom.MutableIndexed path;
The path for all parsers to search.
static public Parser current_parser;
The current parser.
int global_num_errors;
The global number of errors counted.
int global_num_warnings;
The global number of warnings counted.
tom.MutableArray tokens_by_number;
Mapping from token number to token name for this parser class.
public boolean trace_default;
A default value for tracing, per parser class.

Tracing

methods

tom.OutputStream (s)
  help tom.OutputStream s
  done tom.MutableKeyed done;
Output information on the tom.ByteString unit arguments.

void
  load tom.MutableArray arguments;
Digest any :trace-parser arguments.

void
  set_trace_default boolean value;
Undocumented.

deferred void
  fill_tokens_by_number;
Undocumented.

The search path

void
  addToPath tom.String directory;
Add the directory to the search path.

tom.Indexed
  path;
Return the path.

Errors and other reports

tom.OutputStream
  errorStream;
Return the stream to which to output errors. The default stream is err.

int
  num_errors;
Return the global_num_errors. (The variable isn't public to share a few selectors.)

int
  num_warnings;
Return the global_num_warnings.

tom.OutputStream
  error;
Return the stream to which to report an error by asking the current_parser.

tom.OutputStream
  error FileElement object;
Return the stream to which to report an error for the object, similar to error.

tom.OutputStream
  report;
Return the stream to which to report something by asking the current_parser.

tom.OutputStream
  report FileElement object;
Return the stream to which to report something for the object, similar to an error but without counting it as one.

tom.OutputStream
  warning;
Return the stream to which to report a warning by asking the current_parser.

tom.OutputStream
  warning FileElement object;
Return the stream to which to report a warning for the object, similar to warning.

instance gps.Parser

variables

public Lexer lex;
The lexer from which we get the tokens.
int token;
The current token.
public int num_errors;
The number of errors and warnings reported through this parser.
public int num_warnings;
public boolean trace;
Iff !0, we output all kinds of nice debugging information.

methods

tom.OutputStream
  describe tom.OutputStream s
     token int token;
Describe the token on the output stream s.

tom.OutputStream
  describe tom.OutputStream s
    tokens tom.Enumerator e;
Describe the tokens from the enumerator e on the output stream s.

tom.OutputStream
  errorStream;
Return the stream to which to output errors. The default stream is err.

tom.OutputStream
  error;
Return the stream to which to report an error.

tom.OutputStream
  error FileElement object;
Return the stream to which to report an error for the object, similar to error.

tom.OutputStream
  report;
Return the stream to which to report something.

tom.OutputStream
  report FileElement object;
Return the stream to which to report something for the object, similar to error, but without counting it as one.

tom.OutputStream
  warning;
Return the stream to which to report a warning.

tom.OutputStream
  warning FileElement object;
Return the stream to which to report a warning for the object, similar to warning.

tom.OutputStream
  syntaxError;
Return the stream to which to report a syntax error.

void
  fatalError;
Issue the error and exit.

Miscellaneous

id
  init Lexer l;
Designated initializer.

int
  nextToken;
Undocumented.

void
  set_trace boolean value;
Undocumented.

void
  term int expected;
Undocumented.

tom.Array
  tokens_by_number;
Undocumented.


Generated by tm 1.01.