Inherits Garbage
The Parser class does basic C++ parsing.
It doesn't actually parse C++: all it does is lend some support to the header and source handling, which needs to find certain constructs and look at them.
Constructs a Parser for string s. The parser's cursor is left at the beginning of s.
Parses an argument list (for a particularly misleading meaning of parse) and returns it. The cursor must be on the leading '(', it will be left immediately after the trailing ')'.
The argument list is returned including parentheses. In case of an error, an empty string is returned and the cursor is left near the error.
Returns true if the parser has reached the end of its input, and false if not.
Scans past the complex identifier starting at j, returning the first position after the identifier. If something goes wrong, complexIdentifier() returns j.
A complex identifier is anything that may be used as an identifier in C++, even "operator const char *".
Returns the C++ identifier at the cursor, or an empty string if there isn't any. Steps past the identifier and any trailing whitespace.
Returns the parser's current line number.
The line number is that of the first unparsed nonwhitespace character. This implies that if the parser's cursor is at the end of a line, then the line number returned is that of the next nonempty line.
Returns true if the first unparsed characters of the string are the same as pattern, and false if not.
Reads past an operator name starting at j and returns the index of the following characters. If j does not point to an operator name, operatorHack() returns j.
Scans forward until an instance of text is found, and positions the cursor at the first character after that string.
Scans past the simpler identifier starting at j, returning the first position afte the identifier. If something goes wrong, simpleIdentifier() returns j.
A simple identifier is a text label not containing ::, <, >, whitespace or the like.
Steps the Parser past one character.
Scans for text and returns all the text, without the trailing instance of text. The cursor is left after text.
Parses a type name starting at j and returns the first character after the type name (and after trailing whitespace). If a type name can't be parsed, j is returned.
Parses a type specifier and returns it as a string. If the cursor doesn't point to one, type() returns an empty string.
Parses and steps past a single value, which is either a number of an identifier.
Steps past the whitespace starting at j and return the index of the first following nonwhitespace character.
Scans past whitespace, leaving the cursor at the end or at a nonwhitespace character.
Parses and steps past a single word. If the next nonwhitespace character is not a word character, this function returns an empty string.
This web page based on source code belonging to Oryx Mail Systems GmbH. All rights reserved.