Decaf Compiler
Macros | Functions
p1-lexer.c File Reference

Compiler phase 1: lexer. More...

#include "p1-lexer.h"

Macros

#define FREE_REGEXES
 

Functions

TokenQueuelex (const char *text)
 Convert a string containing a Decaf program into a queue of tokens. More...
 

Detailed Description

Compiler phase 1: lexer.

Macro Definition Documentation

◆ FREE_REGEXES

#define FREE_REGEXES
Value:
Regex_free(ws); \
Regex_free(cmt); \
Regex_free(nl); \
Regex_free(id); \
Regex_free(dec); \
Regex_free(hex); \
Regex_free(str); \
Regex_free(sym2); \
Regex_free(sym1); \
Regex_free(key); \
Regex_free(rsrv);

Function Documentation

◆ lex()

TokenQueue* lex ( const char *  text)

Convert a string containing a Decaf program into a queue of tokens.

Parameters
textString to lex
Returns
Newly-created queue of tokens
Regex_free
void Regex_free(Regex *regex)
Deallocate a regular expression.
Definition: token.c:25