Package codeanalysis.syntax
Class Parser
java.lang.Object
codeanalysis.syntax.Parser
The Parser class is responsible for parsing the input text and generating a syntax tree.
It uses a lexer to tokenize the input text and performs syntax analysis to construct the syntax tree.
- Version:
- 1.0
- Author:
- Siyabend Urun
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionParser(SourceText text) Initializes a new instance of the Parser class with the specified input text. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves diagnostic box over the diagnostics produced during parsing.parse()Parses the input text and generates a syntax tree.Parses an assignment expression.
-
Constructor Details
-
Parser
Initializes a new instance of the Parser class with the specified input text.- Parameters:
text- The input text to be parsed.
-
-
Method Details
-
diagnostics
Retrieves diagnostic box over the diagnostics produced during parsing.- Returns:
- An iterator over the diagnostics.
-
parse
Parses the input text and generates a syntax tree.- Returns:
- The syntax tree representing the parsed input.
-
parseAssignmentExpression
Parses an assignment expression.- Returns:
- The parsed expression syntax.
-