OpenMD  2.5
Molecular Dynamics in the Open
antlr Namespace Reference

Namespaces

 anonymous_namespace{TokenStreamRewriteEngine.cpp}
 

Classes

class  ANTLRException
 
class  AST
 
class  ASTArray
 
class  ASTFactory
 
class  ASTNULLType
 
class  ASTPair
 
struct  ASTRef
 
class  ASTRefCount
 
class  BaseAST
 
class  BitSet
 
class  CharBuffer
 
class  CharInputBuffer
 
class  CharScanner
 
class  CharScannerLiteralsLess
 
class  CharStreamException
 
class  CharStreamIOException
 
class  CircularQueue
 
class  CommonAST
 
class  CommonASTWithHiddenTokens
 
class  CommonHiddenStreamToken
 
class  CommonToken
 
class  InputBuffer
 
class  IOException
 
class  LexerInputState
 
class  LLkParser
 
class  MismatchedCharException
 
class  MismatchedTokenException
 
class  NoViableAltException
 
class  NoViableAltForCharException
 
class  Parser
 
class  ParserInputState
 
class  RecognitionException
 
class  RefCount
 
class  SemanticException
 
class  Token
 
class  TokenBuffer
 
struct  TokenRef
 
class  TokenRefCount
 
class  TokenStream
 
class  TokenStreamBasicFilter
 
class  TokenStreamException
 
class  TokenStreamHiddenTokenFilter
 
class  TokenStreamIOException
 
class  TokenStreamRecognitionException
 
class  TokenStreamRetryException
 
class  TokenStreamRewriteEngine
 
class  TokenStreamSelector
 
class  TokenWithIndex
 
class  TreeParser
 
class  TreeParserInputState
 

Typedefs

typedef RefAST(* factory_type_) ()
 
typedef std ::pair< const char *, factory_type_factory_descriptor_
 
typedef std ::vector< factory_descriptor_ *> factory_descriptor_list_
 
typedef ASTRefCount< ASTRefAST
 
typedef ASTRefCount< BaseASTRefBaseAST
 
typedef ASTRefCount< CommonASTRefCommonAST
 
typedef ASTRefCount< CommonASTWithHiddenTokensRefCommonASTWithHiddenTokens
 
typedef RefCount< LexerInputStateLexerSharedInputState
 A reference counted LexerInputState object. More...
 
typedef RefCount< ParserInputStateParserSharedInputState
 A reference counted ParserInputState. More...
 
typedef TokenRefCount< TokenRefToken
 
typedef TokenRefCount< TokenWithIndexRefTokenWithIndex
 
typedef RefCount< TreeParserInputStateTreeParserSharedInputState
 

Functions

std ::istream & eatwhite (std ::istream &is)
 
std ::string read_string (std ::istream &in)
 
std ::string read_identifier (std ::istream &in)
 
void read_AttributeNValue (std ::istream &in, std ::string &attribute, std ::string &value)
 
std ::string operator+ (const std ::string &lhs, const int rhs)
 
std ::string operator+ (const std ::string &lhs, size_t rhs)
 
std ::string charName (int ch)
 
std ::string emptyString ("")
 

Variables

RefAST nullAST
 
AST *const nullASTptr = 0
 
bool DEBUG_PARSER = false
 
RefToken nullToken
 

Typedef Documentation

◆ factory_descriptor_

typedef std ::pair< const char*, factory_type_ > antlr::factory_descriptor_

Definition at line 25 of file ASTFactory.hpp.

◆ factory_descriptor_list_

Definition at line 26 of file ASTFactory.hpp.

◆ factory_type_

typedef RefAST(* antlr::factory_type_) ()

Definition at line 24 of file ASTFactory.hpp.

◆ LexerSharedInputState

A reference counted LexerInputState object.

Definition at line 150 of file LexerSharedInputState.hpp.

◆ ParserSharedInputState

A reference counted ParserInputState.

Definition at line 86 of file ParserSharedInputState.hpp.

◆ RefAST

Definition at line 92 of file ASTRefCount.hpp.

◆ RefBaseAST

Definition at line 20 of file BaseAST.hpp.

◆ RefCommonAST

Definition at line 104 of file CommonAST.hpp.

◆ RefCommonASTWithHiddenTokens

◆ RefToken

Definition at line 92 of file TokenRefCount.hpp.

◆ RefTokenWithIndex

◆ TreeParserSharedInputState

Function Documentation

◆ charName()

std::string antlr::charName ( int  ch)

Convert character to readable string

Definition at line 47 of file String.cpp.

References ANTLR_USE_NAMESPACE.

Referenced by antlr::NoViableAltForCharException::getMessage(), and antlr::MismatchedCharException::getMessage().

◆ eatwhite()

std::istream & antlr::eatwhite ( std ::istream &  is)

Eat whitespace from the input stream

Parameters
isthe stream to read from

Definition at line 22 of file ANTLRUtil.cpp.

References ANTLR_USE_NAMESPACE.

Referenced by read_identifier(), read_string(), and antlr::ASTFactory::setASTNodeFactory().

◆ emptyString()

std ::string antlr::emptyString ( ""  )

◆ operator+() [1/2]

std::string antlr::operator+ ( const std ::string &  lhs,
const int  rhs 
)

Definition at line 31 of file String.cpp.

◆ operator+() [2/2]

std::string antlr::operator+ ( const std ::string &  lhs,
size_t  rhs 
)

Definition at line 38 of file String.cpp.

◆ read_AttributeNValue()

void antlr::read_AttributeNValue ( std ::istream &  in,
std ::string &  attribute,
std ::string &  value 
)

Read a attribute="value" thing. Leading whitespace is skipped. Between attribute and '=' no whitespace is allowed. After the '=' it is permitted.

Parameters
inthe istream to read from.
attributestring the attribute name is put in
valuestring the value of the attribute is put in
Exceptions
IOExceptionif something is fishy. E.g. malformed quoting or missing '='

Read a attribute="value" thing. Leading whitespace is skipped. Between attribute and '=' no whitespace is allowed. After the '=' it is permitted.

Parameters
inthe istream to read from.
attributestring the attribute name is put in
valuestring the value of the attribute is put in
Exceptions
ios_base::failureif something is fishy. E.g. malformed quoting or missing '='

Definition at line 148 of file ANTLRUtil.cpp.

References read_identifier(), and read_string().

◆ read_identifier()

std::string antlr::read_identifier ( std ::istream &  in)

Definition at line 112 of file ANTLRUtil.cpp.

References ANTLR_USE_NAMESPACE, and eatwhite().

Referenced by read_AttributeNValue(), and antlr::ASTFactory::setASTNodeFactory().

◆ read_string()

std::string antlr::read_string ( std ::istream &  in)

Read a string enclosed by '"' from a stream. Also handles escaping of ". Skips leading whitespace.

Parameters
inthe istream to read from.
Returns
the string read from file exclusive the '"'
Exceptions
IOExceptionif string is badly formatted

Read a string enclosed by '"' from a stream. Also handles escaping of ". Skips leading whitespace.

Parameters
inthe istream to read from.
Returns
the string read from file exclusive the '"'
Exceptions
ios_base::failureif string is badly formatted

Definition at line 46 of file ANTLRUtil.cpp.

References ANTLR_USE_NAMESPACE, and eatwhite().

Referenced by read_AttributeNValue().

Variable Documentation

◆ DEBUG_PARSER

bool antlr::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

Definition at line 50 of file Parser.cpp.

◆ nullAST

RefAST antlr::nullAST

Definition at line 271 of file BaseAST.cpp.

Referenced by MDParser::assignment(), MDTreeParser::assignment(), MDParser::atomblock(), MDTreeParser::atomblock(), MDParser::atomstatement(), MDTreeParser::atomstatement(), MDParser::bendblock(), MDTreeParser::bendblock(), MDParser::bendstatement(), MDTreeParser::bendstatement(), MDParser::bondblock(), MDTreeParser::bondblock(), MDParser::bondstatement(), MDTreeParser::bondstatement(), MDParser::componentblock(), MDTreeParser::componentblock(), MDParser::constant(), MDTreeParser::constant(), MDParser::constraintblock(), MDTreeParser::constraintblock(), MDParser::constraintstatement(), MDTreeParser::constraintstatement(), antlr::ASTFactory::create(), MDParser::cutoffgroupblock(), MDTreeParser::cutoffgroupblock(), MDParser::cutoffgroupstatement(), MDTreeParser::cutoffgroupstatement(), MDTreeParser::doubleNumber(), MDParser::doubleNumber(), MDTreeParser::doubleNumberTuple(), MDParser::doubleNumberTuple(), MDParser::floatConst(), MDTreeParser::floatConst(), MDParser::flucqblock(), MDTreeParser::flucqblock(), MDParser::fragmentblock(), MDTreeParser::fragmentblock(), MDParser::fragmentstatement(), MDTreeParser::fragmentstatement(), MDParser::intConst(), MDTreeParser::intConst(), MDParser::inttuple(), MDTreeParser::inttuple(), MDParser::inversionblock(), MDTreeParser::inversionblock(), MDParser::inversionstatement(), MDTreeParser::inversionstatement(), MDParser::mdfile(), MDTreeParser::mdfile(), MDParser::minimizerblock(), MDTreeParser::minimizerblock(), MDParser::moleculeblock(), MDTreeParser::moleculeblock(), MDParser::moleculestatement(), MDTreeParser::moleculestatement(), antlr::BaseAST::removeChildren(), MDParser::restraintblock(), MDTreeParser::restraintblock(), MDParser::rigidbodyblock(), MDTreeParser::rigidbodyblock(), MDParser::rigidbodystatement(), MDTreeParser::rigidbodystatement(), MDParser::rnemdblock(), MDTreeParser::rnemdblock(), antlr::ASTFactory::setASTNodeFactory(), MDParser::statement(), MDTreeParser::statement(), MDParser::torsionblock(), MDTreeParser::torsionblock(), MDParser::torsionstatement(), MDTreeParser::torsionstatement(), MDParser::vectorConst(), MDParser::zconstraintblock(), and MDTreeParser::zconstraintblock().

◆ nullASTptr

AST *const antlr::nullASTptr = 0

Definition at line 277 of file BaseAST.cpp.

Referenced by antlr::ASTFactory::dup(), and antlr::ASTFactory::make().

◆ nullToken