#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

#418 in Programming languages

Download history 117/week @ 2024-04-14 75/week @ 2024-04-21 2/week @ 2024-04-28

194 downloads per month
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
~22K SLoC