ExpParser Class Reference

Base class to handle the logic and lexing in a descendent recursive parser. More...

Inheritance diagram for ExpParser:
ExpParser_SearchFilter

Public Member Functions

 parse ($expr)
 Start parsing of an expression.

Protected Member Functions

 run ()
 Entry point to start parsing.
 trimLeft ()
 Trim whitespaces at the current pointer.
 acceptSym ($tokenlist)
 Accept a symbol.
 expectSym ($tokenlist)
 Excpect a symbol, but fail if not availible.
 acceptKeyword ($keywordlist=false, $case_insensitive=false, $numeric=false)
 Accept a keyword, finished by a whitespace.
 expectKeyword ($keywordlist=false, $case_insensitive=false, $numeric=false)
 Excpect a keyword.
 acceptString ()
 Accept a string.
 expectString ()
 Expect a string.
 acceptNum ()
 Accept a number, (only digits).
 expectNum ()
 Except a number.
 error ($msg)
 Trigger a parser error, format the current position and throw an exception.

Protected Attributes

 $expr
 The expression to parse.
 $ptr
 The current position during parsing, as an integer.

Detailed Description

Base class to handle the logic and lexing in a descendent recursive parser.


Member Function Documentation

ExpParser::acceptString (  )  [protected]

Accept a string.

Strings can be quoted by doublequotes, and may have backslash escape sequences

ExpParser::acceptSym ( tokenlist  )  [protected]

Accept a symbol.

Takes an array of possible symbols, must be ordered from the longest to the shortest.

ExpParser::expectKeyword ( keywordlist = false,
case_insensitive = false,
numeric = false 
) [protected]

Excpect a keyword.

See also:
acceptKeyword
ExpParser::expectNum (  )  [protected]

Except a number.

See also:
acceptNumber
ExpParser::expectString (  )  [protected]

Expect a string.

See also:
acceptString
ExpParser::expectSym ( tokenlist  )  [protected]

Excpect a symbol, but fail if not availible.

See also:
acceptSym
ExpParser::run (  )  [abstract, protected]

Entry point to start parsing.

Runned when the state is set up correctly

Reimplemented in ExpParser_SearchFilter.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables

Generated on 19 Dec 2018 for ninja by  doxygen 1.6.1