Expand description
The wolfpack parser: tokens to a syntax tree (spec chapters 2 and 3).
Recursive descent for declarations and statements, a Pratt parser for expressions. The parser checks the file skeleton (chapter 2) while it reads the sections. It never stops at an error: it reports the problem, skips to a safe point (the end of the line or a closing delimiter) and continues, so that all errors of a file are shown at once. It never panics, and a nesting limit (E0314) keeps deep input from overflowing the stack.
Structs§
- Parsed
- The result of parsing one file.
Constants§
- MAX_
DEPTH - The deepest nesting of expressions, statements, types and patterns the parser accepts.
- STACK_
SIZE - The stack size needed to parse, print and drop a tree nested up to
MAX_DEPTHin a debug build, with a wide margin. Thewolfbinary runs the compiler on a thread of this size; other users of the parser should do the same.
Functions§
- parse
- Parses the tokens of one file, as produced by
wolf_lexer::lex.