AntlrParser Class
Represents an IParser (syntax/semantic analyzer) implementation that can be used to call an ANTLR parser.
public class AntlrParser : ParserBase, IParser, IKeyedObject
- Inheritance:
- Object ParserBase Object
- Implements:
- IParser IKeyedObject
Constructors
AntlrParser(String, Type, Type, String)
Initializes a new instance of the AntlrParser
class.
public AntlrParser(string key, Type coreLexerType, Type coreParserType, string defaultParserMethodName)
Parameter | Type | Description |
---|---|---|
key | String | A string that identifies the parser. |
coreLexerType | Type | The Type of core ANTLR lexer that should be used. This is the lexer Type generated by ANTLR. |
coreParserType | Type | The Type of core ANTLR parser that should be used. This is the parser Type generated by ANTLR. |
defaultParserMethodName | String | The default parser method to call. This is the same as the name of the root rule in your ANTLR grammar. |
Methods
Parse(IParseRequest)
Performs a parsing operation using the parameters specified in the supplied IParseRequest and returns the resulting parse data.
public override IParseData Parse(IParseRequest request)
Parameter | Type | Description |
---|---|---|
request | IParseRequest | The IParseRequest that contains data about the requested parsing operation. |
Returns
- IParseData:
An IParseData that is the result of the parsing operation.
Remarks
A IParseRequestDispatcher typically calls this method when a queued parse request is ready to be processed.