Main Page | Namespace List | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

Parser.cpp File Reference

#include "antlr/Parser.hpp"
#include "antlr/BitSet.hpp"
#include "antlr/TokenBuffer.hpp"
#include "antlr/MismatchedTokenException.hpp"
#include <iostream>

Functions

 ANTLR_USE_NAMESPACE (std) string Parser

Variables

bool DEBUG_PARSER = false

Function Documentation

ANTLR_USE_NAMESPACE std   )  const
 

SOFTWARE RIGHTS

ANTLR 2.6.0 MageLang Insitute, 1998

We reserve no legal rights to the ANTLR--it is fully in the public domain. An individual or company may do whatever they wish with source code distributed with ANTLR or the code generated by ANTLR, including the incorporation of ANTLR, or its output, into commerical software.

We encourage users to develop software with ANTLR. However, we do ask that credit is given to us for developing ANTLR. By "credit", we mean that if you use ANTLR or incorporate any source code into one of your programs (commercial product, research project, or otherwise) that you acknowledge this fact somewhere in the documentation, research report, etc... If you like ANTLR and have developed a nice tool with the output, please mention that you developed it using ANTLR. In addition, we ask that the headers remain intact in our source code. As long as these guidelines are kept, we expect to continue enhancing this system and expect to make other tools available as they are completed.

The ANTLR gang:

Version:
ANTLR 2.6.0 MageLang Insitute, 1998
Author:
Terence Parr, MageLang Institute


John Lilley, Empathy Software


Pete Wells


Variable Documentation

bool DEBUG_PARSER = false
 

A generic ANTLR parser (LL(k) for k>=1) containing a bunch of utility routines useful at any lookahead depth. We distinguish between the LL(1) and LL(k) parsers because of efficiency. This may not be necessary in the near future.

Each parser object contains the state of the parse including a lookahead cache (the form of which is determined by the subclass), whether or not the parser is in guess mode, where tokens come from, etc...

During guess mode, the current lookahead token(s) and token type(s) cache must be saved because the token stream may not have been informed to save the token (via mark) before the try block. Guessing is started by:

  1. saving the lookahead cache.
  2. marking the current position in the TokenBuffer.
  3. increasing the guessing level.

After guessing, the parser state is restored by:

  1. restoring the lookahead cache.
  2. rewinding the TokenBuffer.
  3. decreasing the guessing level.

See also:
antlr.Token

antlr.TokenBuffer

antlr.TokenStream

antlr.LL1Parser

antlr.LLkParser


Generated on Sat Jun 28 15:08:58 2003 for Vampire by doxygen 1.3.2