Class ALinearCParser
Unit
linearc
Declaration
type ALinearCParser = class(AParsedLanguageParser)
Description
This class represents a parser for the LinearC language. It descends from AParsedLanguageParser because the parser does not output to an intermediate code stream, and though it still makes use of a symbol table representative of the options that can be set on the command line by the user, it needs only one of those.
The parser automatically constructs an instance of TheLinearCLanguage to manage the tokens it parses. This language specification will be freed when the parser is freed.
To use the parser, simply pass an instance of AStringStream that contains a string with all command-line options on it to the constructor, then call ALinearCParser.parse.
Hierarchy
Overview
Fields
Methods
Description
Fields
Methods
|
function readyToParse: boolean; override; |
Initialize the parser prior to parsing the source.
This method builds on the behavior inherited from AParsedLanguageParser.readyToParse. It calls the inherited routine and, if that routine returns True to indicate all is well, it checks to see whether Self.Scanner is Nil , indicating that a descendant class has not yet assigned a scanner to the parser. If not, the method constructs an instance of ASourceScanner.
The method also checks to see whether Self.Options is Nil , indicating that a descendant class has not yet assigned a list of options to the parser. If not, the method attempts to borrow the reference from its parent parser, if one is available.
The method returns True only if the inherited routine returns true and if both Self.Scanner and Self.Options are not Nil .
Returns
True if the parser is ready to parse; False if not.
|
|
constructor forSource(const ThisSource: AStream; const takeOwnershipOfSource: boolean; const TheseOptions: ACommandLineOptionDictionary; const ThisLog: ALog); overload; virtual; |
Construct a new instance of ALinearCParser that will parse the command line represented by ThisSource using the options specified by TheseOptions , and outputting error and status information to ThisLog .
This method constructs a new instance of ATextInputStream around ThisSource . That instance will be freed when the parser is freed. takeOwnershipOfSource is passed to ATextInputStream.around.
|
|
constructor forSource(const ThisParent: AParser); override; |
Construct a new parser that will inherit the properties of its parent parser.
The new parser will inherit the values of ThisParent 's Scanner, Source, Log, and Options.
|
|
function init: boolean; override; |
Initializer
|
|
function Options: ACommandLineOptionDictionary; virtual; |
Retrieve a reference to the dictionary of command-line options that may be set by the user.
The caller should NOT attempt to free this reference before freeing the parser.
|
Generated by PasDoc 0.13.0 on 2015-06-25 11:07:51
|