Interface Ast
- All Known Implementing Classes:
Ast.DefaultAst
public interface Ast
Interface to generate abstract syntax tree from tokens. Generic language
parser usually contains lexing and parsing where this
Ast
represents
the latter parsing side.
Parsing looks tokens and combines those together into nodes and we get
closer to understand commands, its options and arguments whether those
belong to command or option. Parser don't look if for example option
arguments makes sense which happen later when ast tree is visited.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final record
Representing result from tokens to ast tree generation.static class
Default implementation of anAst
. -
Method Summary
Modifier and TypeMethodDescriptionGenerate ast result from a tokens.
-
Method Details
-
generate
Generate ast result from a tokens.Ast.AstResult
contains info about token to ast tree generation.- Parameters:
tokens
- the tokens- Returns:
- a result containing further syntax info
-