-
Notifications
You must be signed in to change notification settings - Fork 29
/
references.txt
94 lines (53 loc) · 1.97 KB
/
references.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
Resources
http://www.cheatography.com/davechild/cheat-sheets/regular-expressions/
http://www.tutorialspoint.com/compiler_design/compiler_design_phases_of_compiler.htm
http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora065.html
http://web.stanford.edu/class/cs143/
http://www.personal.kent.edu/~rmuhamma/Compilers/MyCompiler/phase.htm
TODO
C++ Boost
Do everything below ---------
Tools
Flex
Bison
Tokeniser
1. cin >> all the information in the .c file as a series of char / strings. Then match them with one of the token types and cout the answer.
List of token types
Good reference - http://www.codeproject.com/Articles/833206/Lexical-analyzer-an-example
Case insensitive
All English letters (upper and lower), digits, and extra characters as seen below, plus whitespace
Identifiers
begin with a letter, and continue with any number of letters
Keywords (reserved), include: start finish then if repeat var int float do read print void return dummy program
Relational operators, include: == < > =!= => =<
Other operators, include: = : + - * / %
Delimiters, include: . ( ) , { } ; [ ]
Numbers:
any sequence of decimal digits, no sign
assume no number is longer than 8 digits
Other assumption:
No whitespace needed to separate tokens except when this changes the tokens (as x y vs xy)
Comments start with // and end with new line
typedef enum{
IDENTIFIER,
KEYWORD,
NUMBER, // isnum()
RELATION_OPERATOR,
OPERATOR,
DELIMITER,
UNDEF,
EOT
}TokenType;
Parser
Code Generation
Compiler
General References
http://dragonbook.stanford.edu/
http://web.stanford.edu/class/cs143/
-------
http://dinosaur.compilertools.net/
https://www.reddit.com/r/programming/comments/92hqz/how_do_i_get_started_in_learning_about_compilers/
http://stackoverflow.com/questions/5456011/how-to-compile-lex-yacc-files-on-windows
http://www.regular-expressions.info/dot.html
Regex
http://regexone.com/