Changeset 7c2bff65d061982575740ffc7a1cb7b7597e8607
- Timestamp:
- 05/28/2008 11:45:15 PM
(7 months ago)
- Author:
- mitchell <mitchell@frost.(none)>
- git-committer:
- mitchell <mitchell@frost.(none)> 1212043515 -0400
- git-parent:
[8aa59f943aceba9355319025a245ef8e0484b753]
- git-author:
- mitchell <mitchell@frost.(none)> 1212043515 -0400
- Message:
Added #ifndef ... #endif around parsers; they are header files after all.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r0844a1a |
r7c2bff6 |
|
| 22 | 22 | |
|---|
| 23 | 23 | /************************* Required for every parser *************************/ |
|---|
| | 24 | #ifndef RAGEL_C_PARSER |
|---|
| | 25 | #define RAGEL_C_PARSER |
|---|
| | 26 | |
|---|
| 24 | 27 | #include "ragel_parser_macros.h" |
|---|
| 25 | 28 | |
|---|
| … | … | |
| 42 | 45 | |
|---|
| 43 | 46 | And the following at the bottom: |
|---|
| | 47 | |
|---|
| | 48 | /************************* Required for every parser *************************/ |
|---|
| 44 | 49 | |
|---|
| 45 | 50 | /* Parses a string buffer with C/C++ code. |
|---|
| … | … | |
| 75 | 80 | } |
|---|
| 76 | 81 | |
|---|
| | 82 | #endif |
|---|
| | 83 | |
|---|
| | 84 | /*****************************************************************************/ |
|---|
| | 85 | |
|---|
| 77 | 86 | (Your parser will go between these two blocks.) |
|---|
| 78 | 87 | |
|---|
| 79 | 88 | The code can be found in the existing c.rl parser. You will need to change: |
|---|
| | 89 | * RAGEL_[lang]_PARSER - Replace [lang] with your language name. So if you |
|---|
| | 90 | are writing a C parser, it would be RAGEL_C_PARSER. |
|---|
| 80 | 91 | * [lang]_LANG - Set the variable name to be [lang]_LANG and its value to be |
|---|
| 81 | | the name of your language to parse. [lang] is your language name. So if |
|---|
| 82 | | you are writing a C parser, it would be C_LANG. |
|---|
| | 92 | the name of your language to parse. [lang] is your language name. For C it |
|---|
| | 93 | would be C_LANG. |
|---|
| 83 | 94 | * [lang]_entities - Set the variable name to be [lang]_entities (e.g. |
|---|
| 84 | 95 | c_entries) The value is an array of string entities your language has. |
|---|
| r0844a1a |
r7c2bff6 |
|
| 2 | 2 | |
|---|
| 3 | 3 | /************************* Required for every parser *************************/ |
|---|
| | 4 | #ifndef RAGEL_C_PARSER |
|---|
| | 5 | #define RAGEL_C_PARSER |
|---|
| | 6 | |
|---|
| 4 | 7 | #include "ragel_parser_macros.h" |
|---|
| 5 | 8 | |
|---|
| … | … | |
| 148 | 151 | *|; |
|---|
| 149 | 152 | }%% |
|---|
| | 153 | |
|---|
| | 154 | /************************* Required for every parser *************************/ |
|---|
| 150 | 155 | |
|---|
| 151 | 156 | /* Parses a string buffer with C/C++ code. |
|---|
| … | … | |
| 190 | 195 | C_LANG = ORIG_C_LANG; |
|---|
| 191 | 196 | } |
|---|
| | 197 | |
|---|
| | 198 | #endif |
|---|
| | 199 | |
|---|
| | 200 | /*****************************************************************************/ |
|---|
| r0844a1a |
r7c2bff6 |
|
| 2 | 2 | |
|---|
| 3 | 3 | /************************* Required for every parser *************************/ |
|---|
| | 4 | #ifndef RAGEL_JAVA_PARSER |
|---|
| | 5 | #define RAGEL_JAVA_PARSER |
|---|
| | 6 | |
|---|
| 4 | 7 | #include "ragel_parser_macros.h" |
|---|
| 5 | 8 | |
|---|
| … | … | |
| 76 | 79 | }%% |
|---|
| 77 | 80 | |
|---|
| | 81 | /************************* Required for every parser *************************/ |
|---|
| | 82 | |
|---|
| 78 | 83 | /* Parses a string buffer with Java code. |
|---|
| 79 | 84 | * |
|---|
| … | … | |
| 107 | 112 | if (count) { process_last_line(JAVA_LANG) } |
|---|
| 108 | 113 | } |
|---|
| | 114 | |
|---|
| | 115 | #endif |
|---|
| | 116 | |
|---|
| | 117 | /*****************************************************************************/ |
|---|
| r0844a1a |
r7c2bff6 |
|
| 2 | 2 | |
|---|
| 3 | 3 | /************************* Required for every parser *************************/ |
|---|
| | 4 | #ifndef RAGEL_LUA_PARSER |
|---|
| | 5 | #define RAGEL_LUA_PARSER |
|---|
| | 6 | |
|---|
| 4 | 7 | #include "ragel_parser_macros.h" |
|---|
| 5 | 8 | |
|---|
| … | … | |
| 106 | 109 | }%% |
|---|
| 107 | 110 | |
|---|
| | 111 | /************************* Required for every parser *************************/ |
|---|
| | 112 | |
|---|
| 108 | 113 | /* Parses a string buffer with Lua code. |
|---|
| 109 | 114 | * |
|---|
| … | … | |
| 139 | 144 | if (count) { process_last_line(LUA_LANG) } |
|---|
| 140 | 145 | } |
|---|
| | 146 | |
|---|
| | 147 | #endif |
|---|
| | 148 | |
|---|
| | 149 | /*****************************************************************************/ |
|---|
| r0844a1a |
r7c2bff6 |
|
| 2 | 2 | |
|---|
| 3 | 3 | /************************* Required for every parser *************************/ |
|---|
| | 4 | #ifndef RAGEL_OBJECTIVE_C_PARSER |
|---|
| | 5 | #define RAGEL_OBJECTIVE_C_PARSER |
|---|
| | 6 | |
|---|
| 4 | 7 | #include "ragel_parser_macros.h" |
|---|
| 5 | 8 | |
|---|
| … | … | |
| 81 | 84 | }%% |
|---|
| 82 | 85 | |
|---|
| | 86 | /************************* Required for every parser *************************/ |
|---|
| | 87 | |
|---|
| 83 | 88 | /* Parses a string buffer with Objective C code. |
|---|
| 84 | 89 | * |
|---|
| … | … | |
| 112 | 117 | if (count) { process_last_line(OBJC_LANG) } |
|---|
| 113 | 118 | } |
|---|
| | 119 | |
|---|
| | 120 | #endif |
|---|
| | 121 | |
|---|
| | 122 | /*****************************************************************************/ |
|---|
| r0844a1a |
r7c2bff6 |
|
| 2 | 2 | |
|---|
| 3 | 3 | /************************* Required for every parser *************************/ |
|---|
| | 4 | #ifndef RAGEL_RUBY_PARSER |
|---|
| | 5 | #define RAGEL_RUBY_PARSER |
|---|
| | 6 | |
|---|
| 4 | 7 | #include "ragel_parser_macros.h" |
|---|
| 5 | 8 | |
|---|
| … | … | |
| 151 | 154 | }%% |
|---|
| 152 | 155 | |
|---|
| | 156 | /************************* Required for every parser *************************/ |
|---|
| | 157 | |
|---|
| 153 | 158 | /* Parses a string buffer with Ruby code. |
|---|
| 154 | 159 | * |
|---|
| … | … | |
| 182 | 187 | if (count) { process_last_line(RUBY_LANG) } |
|---|
| 183 | 188 | } |
|---|
| | 189 | |
|---|
| | 190 | #endif |
|---|
| | 191 | |
|---|
| | 192 | /*****************************************************************************/ |
|---|
| r0844a1a |
r7c2bff6 |
|
| 2 | 2 | |
|---|
| 3 | 3 | /************************* Required for every parser *************************/ |
|---|
| | 4 | #ifndef RAGEL_SQL_PARSER |
|---|
| | 5 | #define RAGEL_SQL_PARSER |
|---|
| | 6 | |
|---|
| 4 | 7 | #include "ragel_parser_macros.h" |
|---|
| 5 | 8 | |
|---|
| … | … | |
| 82 | 85 | }%% |
|---|
| 83 | 86 | |
|---|
| | 87 | /************************* Required for every parser *************************/ |
|---|
| | 88 | |
|---|
| 84 | 89 | /* Parses a string buffer with SQL code. |
|---|
| 85 | 90 | * |
|---|
| … | … | |
| 113 | 118 | if (count) { process_last_line(SQL_LANG) } |
|---|
| 114 | 119 | } |
|---|
| | 120 | |
|---|
| | 121 | #endif |
|---|
| | 122 | |
|---|
| | 123 | /*****************************************************************************/ |
|---|
| r0844a1a |
r7c2bff6 |
|
| 2 | 2 | |
|---|
| 3 | 3 | /************************* Required for every parser *************************/ |
|---|
| | 4 | #ifndef RAGEL_VISUAL_BASIC_PARSER |
|---|
| | 5 | #define RAGEL_VISUAL_BASIC_PARSER |
|---|
| | 6 | |
|---|
| 4 | 7 | #include "ragel_parser_macros.h" |
|---|
| 5 | 8 | |
|---|
| … | … | |
| 63 | 66 | }%% |
|---|
| 64 | 67 | |
|---|
| | 68 | /************************* Required for every parser *************************/ |
|---|
| | 69 | |
|---|
| 65 | 70 | /* Parses a string buffer with Visual Basic code. |
|---|
| 66 | 71 | * |
|---|
| … | … | |
| 94 | 99 | if (count) { process_last_line(VB_LANG) } |
|---|
| 95 | 100 | } |
|---|
| | 101 | |
|---|
| | 102 | #endif |
|---|
| | 103 | |
|---|
| | 104 | /*****************************************************************************/ |
|---|