|
|
This includes most of a grammar for a PP domain-specific language.
Syntactically and behaviorally it is very much like C, with reduced types
(int, string, bool, no structs, no enums). Most of the PP-specific actions
are simple function calls.
Major departures from C are:
- dynamic typing, with optional runtime checking
- function literals and anonymous functions
- list/tuple literals
- symbols are private unless declard public
- no headers
I have converted all of the existing device code to the new syntax, with a few
bits of hand-waving to work out still. The actual interpreter for the
language is yet to be written. :)
I'm sending this change as a chance to get some feedback.
Tim
Makefile | 78
grammar.l | 1012 +++++
grammar.y | 882 +++++
identifier.h | 78
language.cpp | 304 +
language.h | 146
lexer_test.cpp | 838 ++++
main_lex.cpp | 36
main_parse.cpp | 20
pipe_file.h | 244 +
pp-files/amd_k8.pp | 9168 +++++++++++++++++++++++++++++++++++++++++++++++++++++
pp-files/cpu.pp | 51
pp-files/cpuid.pp | 3543 ++++++++++++++++++++
pp-files/msr.pp | 924 +++++
pp-files/pci.pp | 6018 ++++++++++++++++++++++++++++++++++
pp-files/pp.pp | 267 +
string_file.h | 116
variable.h | 218 +
variable_test.cpp | 152
19 files changed, 24095 insertions(+)
Total comments: 10
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+24095 lines, -0 lines) |
Patch |
 |
A |
language/Makefile
|
View
|
|
1 chunk |
+39 lines, -0 lines |
0 comments
|
Download
|
 |
|
language/Makefile
|
View
|
|
1 chunk |
+39 lines, -0 lines |
0 comments
|
Download
|
 |
A |
language/grammar.l
|
View
|
|
1 chunk |
+506 lines, -0 lines |
4 comments
|
Download
|
 |
|
language/grammar.l
|
View
|
|
1 chunk |
+506 lines, -0 lines |
0 comments
|
Download
|
 |
A |
language/grammar.y
|
View
|
|
1 chunk |
+441 lines, -0 lines |
6 comments
|
Download
|
 |
|
language/grammar.y
|
View
|
|
1 chunk |
+441 lines, -0 lines |
0 comments
|
Download
|
 |
A |
language/identifier.h
|
View
|
|
1 chunk |
+39 lines, -0 lines |
0 comments
|
Download
|
 |
|
language/identifier.h
|
View
|
|
1 chunk |
+39 lines, -0 lines |
0 comments
|
Download
|
 |
A |
language/language.h
|
View
|
|
1 chunk |
+73 lines, -0 lines |
0 comments
|
Download
|
 |
|
language/language.h
|
View
|
|
1 chunk |
+73 lines, -0 lines |
0 comments
|
Download
|
 |
A |
language/language.cpp
|
View
|
|
1 chunk |
+152 lines, -0 lines |
0 comments
|
Download
|
 |
|
language/language.cpp
|
View
|
|
1 chunk |
+152 lines, -0 lines |
0 comments
|
Download
|
 |
A |
language/lexer_test.cpp
|
View
|
|
1 chunk |
+419 lines, -0 lines |
0 comments
|
Download
|
 |
|
language/lexer_test.cpp
|
View
|
|
1 chunk |
+419 lines, -0 lines |
0 comments
|
Download
|
 |
A |
language/main_lex.cpp
|
View
|
|
1 chunk |
+18 lines, -0 lines |
0 comments
|
Download
|
 |
|
language/main_lex.cpp
|
View
|
|
1 chunk |
+18 lines, -0 lines |
0 comments
|
Download
|
 |
A |
language/main_parse.cpp
|
View
|
|
1 chunk |
+10 lines, -0 lines |
0 comments
|
Download
|
 |
|
language/main_parse.cpp
|
View
|
|
1 chunk |
+10 lines, -0 lines |
0 comments
|
Download
|
 |
A |
language/pipe_file.h
|
View
|
|
1 chunk |
+122 lines, -0 lines |
0 comments
|
Download
|
 |
|
language/pipe_file.h
|
View
|
|
1 chunk |
+122 lines, -0 lines |
0 comments
|
Download
|
 |
A |
language/pp-files/amd_k8.pp
|
View
|
|
1 chunk |
+3056 lines, -0 lines |
0 comments
|
Download
|
 |
|
language/pp-files/amd_k8.pp
|
View
|
|
1 chunk |
+3056 lines, -0 lines |
0 comments
|
Download
|
 |
|
language/pp-files/amd_k8.pp
|
View
|
|
1 chunk |
+3056 lines, -0 lines |
0 comments
|
Download
|
 |
A |
language/pp-files/cpu.pp
|
View
|
|
1 chunk |
+17 lines, -0 lines |
0 comments
|
Download
|
 |
|
language/pp-files/cpu.pp
|
View
|
|
1 chunk |
+17 lines, -0 lines |
0 comments
|
Download
|
 |
|
language/pp-files/cpu.pp
|
View
|
|
1 chunk |
+17 lines, -0 lines |
0 comments
|
Download
|
 |
A |
language/pp-files/cpuid.pp
|
View
|
|
1 chunk |
+1181 lines, -0 lines |
0 comments
|
Download
|
 |
|
language/pp-files/cpuid.pp
|
View
|
|
1 chunk |
+1181 lines, -0 lines |
0 comments
|
Download
|
 |
|
language/pp-files/cpuid.pp
|
View
|
|
1 chunk |
+1181 lines, -0 lines |
0 comments
|
Download
|
 |
A |
language/pp-files/msr.pp
|
View
|
|
1 chunk |
+308 lines, -0 lines |
0 comments
|
Download
|
 |
|
language/pp-files/msr.pp
|
View
|
|
1 chunk |
+308 lines, -0 lines |
0 comments
|
Download
|
 |
|
language/pp-files/msr.pp
|
View
|
|
1 chunk |
+308 lines, -0 lines |
0 comments
|
Download
|
 |
A |
language/pp-files/pci.pp
|
View
|
|
1 chunk |
+2006 lines, -0 lines |
0 comments
|
Download
|
 |
|
language/pp-files/pci.pp
|
View
|
|
1 chunk |
+2006 lines, -0 lines |
0 comments
|
Download
|
 |
|
language/pp-files/pci.pp
|
View
|
|
1 chunk |
+2006 lines, -0 lines |
0 comments
|
Download
|
 |
A |
language/pp-files/pp.pp
|
View
|
|
1 chunk |
+89 lines, -0 lines |
0 comments
|
Download
|
 |
|
language/pp-files/pp.pp
|
View
|
|
1 chunk |
+89 lines, -0 lines |
0 comments
|
Download
|
 |
|
language/pp-files/pp.pp
|
View
|
|
1 chunk |
+89 lines, -0 lines |
0 comments
|
Download
|
 |
A |
language/string_file.h
|
View
|
|
1 chunk |
+58 lines, -0 lines |
0 comments
|
Download
|
 |
|
language/string_file.h
|
View
|
|
1 chunk |
+58 lines, -0 lines |
0 comments
|
Download
|
 |
A |
language/variable.h
|
View
|
|
1 chunk |
+109 lines, -0 lines |
0 comments
|
Download
|
 |
|
language/variable.h
|
View
|
|
1 chunk |
+109 lines, -0 lines |
0 comments
|
Download
|
 |
A |
language/variable_test.cpp
|
View
|
|
1 chunk |
+76 lines, -0 lines |
0 comments
|
Download
|
 |
|
language/variable_test.cpp
|
View
|
|
1 chunk |
+76 lines, -0 lines |
0 comments
|
Download
|
Total messages: 2
|