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

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    Representing result from tokens to ast tree generation.
    static class 
    Default implementation of an Ast.
  • Method Summary

    Modifier and Type
    Method
    Description
    generate(List<Token> tokens)
    Generate ast result from a tokens.
  • Method Details

    • generate

      Ast.AstResult generate(List<Token> tokens)
      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