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:
- System.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 | System.String | A string that identifies the parser. |
coreLexerType | System.Type | The System.Type of core ANTLR lexer that should be used. This is the lexer System.Type generated by ANTLR. |
coreParserType | System.Type | The System.Type of core ANTLR parser that should be used. This is the parser System.Type generated by ANTLR. |
defaultParserMethodName | System.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.
Inherited Members
- ParserBase.Key
- System.Object.ToString()
- System.Object.Equals(System.Object)
- System.Object.Equals(System.Object, System.Object)
- System.Object.ReferenceEquals(System.Object, System.Object)
- System.Object.GetHashCode()
- System.Object.GetType()
- System.Object.MemberwiseClone()