Package quickparse.parsing
Interface Parser
- All Known Implementing Classes:
RecursiveDescentParser
public interface Parser
Represents a generic parser.
A parser takes a
sequence of characters as input and returns a syntax tree as output.-
Method Summary
Modifier and Type Method Description SyntaxTreeparse(java.lang.CharSequence source)Parses aCharSequencestarting from the proper axiom of agrammarSyntaxTreeparse(java.lang.CharSequence source, java.lang.String axiom)Parses aCharSequencestarting from the specified construct of agrammar
-
Method Details
-
parse
SyntaxTree parse(java.lang.CharSequence source) throws ExpectedSymbolsException, UnexpectedSymbolExceptionParses aCharSequencestarting from the proper axiom of agrammar- Parameters:
source- the sourceCharSequenceto parse- Returns:
- A
SyntaxTreeobject - Throws:
ExpectedSymbolsException- if an expected symbol is not found at some positionUnexpectedSymbolException- if an unexpected symbol is found at the end of the sourceCharSequence
-
parse
SyntaxTree parse(java.lang.CharSequence source, java.lang.String axiom) throws ExpectedSymbolsException, UnexpectedSymbolExceptionParses aCharSequencestarting from the specified construct of agrammar- Parameters:
source- the sourceCharSequenceto parseaxiom- the construct name to use as the axiom for the parsing process- Returns:
- A
SyntaxTreeobject - Throws:
ExpectedSymbolsException- if an expected symbol is not found at some positionUnexpectedSymbolException- if an unexpected symbol is found at the end of the sourceCharSequence
-