View on GitHub

Riddim

Interpreted language made in C++ designed for algorithms / data structures

Parser / lexer

The parser and the lexer are managed via Bison / Flex. That is, the parser is LALR(1).

Lexer

The file containing rules is src/scanner.ll. To parse tokens, tokens.{cc,hh} files are used (convert int, strings…). To avoid issues with extra line feeds at the start / the end of the file, a new line token is added at the start and at the end of the file. This is done in driver.cc.

Parser

The file containing the grammar rules is src/parser.yy. There are multiple sections :

Expressions

Expressions are complex because of precedence, some expressions must be parsed before others. To avoid conflicts, here are the types of expressions :

Expressions are parsed in order from primary to exp (primary has a greater precedence than exp).