Class Parser

java.lang.Object
org.openjdk.asmtools.jasm.ParseBase
org.openjdk.asmtools.jasm.Parser

class Parser extends ParseBase
This class is used to parse Jasm statements and expressions. The result is a parse tree.

This class implements an operator precedence parser. Errors are reported to the Environment object, if the error can't be resolved immediately, a SyntaxError exception is thrown.

Error recovery is implemented by catching Scanner.SyntaxError exceptions and discarding input scanner.tokens until an input token is reached that is possibly a legal continuation.

The parse tree that is constructed represents the input exactly (no rewrites to simpler forms). This is important if the resulting tree is to be used for code formatting in a programming environment. Currently only documentation comments are retained.

A parser owns several components (scanner, constant-parser, instruction-parser, annotations-parser) to which it delegates certain parsing responsibilities. This parser contains functions to parse the overall form of a class, and any members (fields, methods, inner-classes).

Syntax errors, should always be caught inside the parser for error recovery.