Class Parser

java.lang.Object
codeanalysis.syntax.Parser

public class Parser extends Object
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 Details

    • Parser

      public Parser(SourceText text)
      Initializes a new instance of the Parser class with the specified input text.
      Parameters:
      text - The input text to be parsed.
  • Method Details

    • diagnostics

      public DiagnosticBox diagnostics()
      Retrieves diagnostic box over the diagnostics produced during parsing.
      Returns:
      An iterator over the diagnostics.
    • parse

      public SyntaxTree parse()
      Parses the input text and generates a syntax tree.
      Returns:
      The syntax tree representing the parsed input.
    • parseAssignmentExpression

      public ExpressionSyntax parseAssignmentExpression()
      Parses an assignment expression.
      Returns:
      The parsed expression syntax.