#compiler #interpreter #programming-language #imp #token #expressions #aexp

yanked imp_parser

A nom-based parser for the IMP programming language

2 releases

0.2.2 Apr 20, 2024
0.2.1 Apr 20, 2024

#5 in #imp


Used in imp_ast

MIT license

75KB
1.5K SLoC

A [nom]-based parser operating on token slices.

Expressions

IMP defines two distinct kinds of expressions: arithmetic and boolean. These have been reified into the aexp::Aexp and bexp::Bexp enums, which define tree-like structures that explicitly model these expressions.

Commands

In the IMP grammar, a command corresponds to a node in a program's abstract syntax tree; these nodes are modelled by the cmd::Cmd enum.

Dependencies

~1MB
~21K SLoC