comparison python/ppci/c3/lexer.py @ 393:6ae782a085e0

Added init program
author Windel Bouwman
date Sat, 17 May 2014 21:17:40 +0200
parents 173e20a47fda
children fb3c1f029b30
comparison
equal deleted inserted replaced
392:bb4289c84907 393:6ae782a085e0
6 Lexical analyzer part. Splits the input character stream into tokens. 6 Lexical analyzer part. Splits the input character stream into tokens.
7 """ 7 """
8 8
9 keywords = ['and', 'or', 'not', 'true', 'false', 9 keywords = ['and', 'or', 'not', 'true', 'false',
10 'else', 'if', 'while', 'for', 'return', 10 'else', 'if', 'while', 'for', 'return',
11 'switch', 'case', 'default',
11 'function', 'var', 'type', 'const', 12 'function', 'var', 'type', 'const',
12 'struct', 'cast', 13 'struct', 'cast', 'sizeof',
13 'import', 'module'] 14 'import', 'module']
14 15
15 16
16 class Lexer: 17 class Lexer:
17 """ Generates a sequence of token from an input stream """ 18 """ Generates a sequence of token from an input stream """