Changeset 095b07b2b451c60d2ee5029942e6a0424a88a5c4

Show
Ignore:
Timestamp:
05/20/2008 03:08:17 PM (8 months ago)
Author:
mitchell <mitchell@frost.(none)>
git-committer:
mitchell <mitchell@frost.(none)> 1211321297 -0400
git-parent:

[27ac54a0b34218f9772e511aae8c5245a0aa83bb]

git-author:
mitchell <mitchell@frost.(none)> 1211321297 -0400
Message:

Updated PARSER_DOC to include non-conflicting constant names.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • PARSER_DOC

    ra53b705 r095b07b  
    2222 
    2323// the name of the language 
    24 const char *LANG = "c"; 
     24const char *C_LANG = "c"; 
    2525 
    2626// the languages entities 
    2727const char *c_entities[] = { 
    2828  "space", "comment", "string", "number", "preproc", "keyword", 
    29   "identifier", "operator", "escaped_newline", "newline", "any" 
     29  "identifier", "operator", "escaped_newline", "newline" 
    3030}; 
    3131 
    3232// constants associated with the entities 
    3333enum { 
    34   SPACE = 0, COMMENT, STRING, NUMBER, PREPROC, KEYWORD, 
    35   IDENTIFIER, OPERATOR, ESCAPED_NL, NEWLINE, ANY 
     34  C_SPACE = 0, C_COMMENT, C_STRING, C_NUMBER, C_PREPROC, C_KEYWORD, 
     35  C_IDENTIFIER, C_OPERATOR, C_ESCAPED_NL, C_NEWLINE 
    3636}; 
    3737 
     
    100100 
    101101  The code can be found in the existing c.rl parser. You'll need to change: 
    102     * LANG - Set the value of LANG to be the name of your language to parse. 
    103     * [lang]_entities - Set the variable name to be [lang]_entities where [lang] 
    104       is your language name. So if you're writing a C parser, it would be 
    105       c_entities. The value is an array of string entities your language has. 
     102    * [lang]_LANG - Set the variable name to be [lang]_LANG and its value to be 
     103      the name of your language to parse. [lang] is your language name. So if 
     104      you're writing a C parser, it would be C_LANG. 
     105    * [lang]_entities - Set the variable name to be [lang]_entities (e.g. 
     106      c_entries) The value is an array of string entities your language has. 
    106107      For example C has comment, string, number, etc. entities. You should 
    107       definately have "space", "newline", and "any" entities. If your language 
    108       has escaped newlines (or continuations), have an "escaped_newline" entity 
    109       as well. 
     108      definately have "space", and "newline" entities. If your language has 
     109      escaped newlines (or continuations), have an "escaped_newline" entity as 
     110      well. 
    110111    * enum - Change the value of the enum to correspond with your entities. So 
    111112      if in your parser you look up [lang]_entities[ENTITY], you'll get the