Crate panfix

source ·

Modules

  • If you want to peek under the hood, and use the components that make up the parser separately.

Macros

  • Describe the syntax of an operator.

Structs

  • A grammar for a language. Add operators until the grammar is complete, then call .finish() to construct a Parser you can use to parse.
  • One “word” in the stream returned by the lexer.
  • An error while parsing. When Displayed, shows the message and the portion of the source it occurred in.
  • The result of parsing a source string. Call .visitor() to walk it.
  • A Panfix grammar, that’s ready to parse.
  • Describe the syntax of an operator. You typically want to construct this with the pattern! macro.
  • A position in the source text. Positions are between characters.
  • Source text, and a “filename” for it (though it need not have been read from a file). Newline positions within the source are indexed, which allows all methods to run in constant time.
  • A start and end position in the source text.
  • One node in a parse tree. Allows you to inspect the node and its children, but not its parent.

Enums

  • Whether an operator takes an argument on the left and/or on the right. For example:
  • An error while constructing a grammar.

Constants

Type Definitions

  • A column number of a source file. Zero indexed.
  • A line number of a source file. Zero indexed.
  • A byte offset into the source file.
  • Precedence level. Smaller is tighter / wins.
  • A category of lexeme, such as “INTEGER” or “VARIABLE” or “OPEN_PAREN”.