Traqula
    Preparing search index...

    Class ParserBuilder<Context, Names, RuleDefs>

    The grammar builder. This is the core of traqula (besides using the amazing chevrotain framework). Using the builder you can create a grammar + AST creator. At any point in time, a parser can be constructed from the added rules. Constructing a parser will cause a validation which will validate the correctness of the grammar.

    Type Parameters

    Index

    Methods

    • Parameters

      • __namedParameters: {
            errorHandler?: (errors: IRecognitionException[]) => void;
            lexerConfig?: ILexerConfig;
            parserConfig?: IParserConfig;
            queryPreProcessor?: (input: string) => string;
            tokenVocabulary: readonly TokenType[];
        }

      Returns ParserFromRules<Context, Names, RuleDefs>

    • Type Parameters

      • Patch extends { [Key in string]?: [any] | [any, any] }

      Returns ParserBuilder<
          Context,
          Names,
          {
              [Key in string]: Key extends keyof Patch
                  ? Patch[Key<Key>] extends [any, any]
                      ? ParserRule<Context, Key<Key>, any[any][0], any[any][1]>
                      : Patch[Key<Key>] extends [any]
                          ? RuleDefs[Key<Key>] extends ParserRule<any, any, any, Par>
                              ? ParserRule<Context, Key<Key>, any[any][0], Par>
                              : never
                          : never
                  : RuleDefs[Key] extends ParserRule<Context, Key> ? any[any] : never
          },
      >