OLD | NEW |
1 #!/usr/bin/tclsh | 1 #!/usr/bin/tclsh |
2 # | 2 # |
3 # This script appends additional token codes to the end of the | 3 # This script appends additional token codes to the end of the |
4 # parse.h file that lemon generates. These extra token codes are | 4 # parse.h file that lemon generates. These extra token codes are |
5 # not used by the parser. But they are used by the tokenizer and/or | 5 # not used by the parser. But they are used by the tokenizer and/or |
6 # the code generator. | 6 # the code generator. |
7 # | 7 # |
8 # | 8 # |
9 set in [open [lindex $argv 0] rb] | 9 set in [open [lindex $argv 0] rb] |
10 set max 0 | 10 set max 0 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 # | 54 # |
55 puts "\n/* The token codes above must all fit in 8 bits */" | 55 puts "\n/* The token codes above must all fit in 8 bits */" |
56 puts [format "#define %-20s %-6s" TKFLG_MASK 0xff] | 56 puts [format "#define %-20s %-6s" TKFLG_MASK 0xff] |
57 puts "\n/* Flags that can be added to a token code when it is not" | 57 puts "\n/* Flags that can be added to a token code when it is not" |
58 puts "** being stored in a u8: */" | 58 puts "** being stored in a u8: */" |
59 foreach {fg val comment} { | 59 foreach {fg val comment} { |
60 TKFLG_DONTFOLD 0x100 {/* Omit constant folding optimizations */} | 60 TKFLG_DONTFOLD 0x100 {/* Omit constant folding optimizations */} |
61 } { | 61 } { |
62 puts [format "#define %-20s %-6s %s" $fg $val $comment] | 62 puts [format "#define %-20s %-6s %s" $fg $val $comment] |
63 } | 63 } |
OLD | NEW |