The parserExists function should be called before active is checked.
[external/ragel.git] / ragel / rlparse.kh
index 5d7b404..ac8cb47 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2006 Adrian Thurston <thurston@cs.queensu.ca>
+ *  Copyright 2001-2007 Adrian Thurston <thurston@cs.queensu.ca>
  */
 
 /*  This file is part of Ragel.
 #include "avltree.h"
 #include "parsedata.h"
 
-extern char *lelNames[];
-
-struct LangEl;
-
 struct Parser
 {
-       %%{
+%%{
        parser Parser;
 
        # These must be declared first and in this order. Ragel currently cannot
@@ -93,9 +89,12 @@ struct Parser
        # semi is sent as a token in the code block rather than as a generic
        # symbol.
        token TK_Semi;
+}%%
 
-       interface;
-       }%%
+       %% write instance_data;
+
+       void init();
+       int parseLangEl( int type, const Token *token );
 
        Parser( char *fileName, char *sectionName, InputLoc &sectionLoc )
                : sectionName(sectionName)
@@ -108,7 +107,7 @@ struct Parser
                JoinOrLm *joinOrLm, bool isInstance );
 
        /* Report an error encountered by the parser. */
-       ostream &parser_error( int tokId, Token &token );
+       ostream &parse_error( int tokId, Token &token );
 
        ParseData *pd;
 
@@ -119,4 +118,6 @@ struct Parser
        NameRefList nameRefList;
 };
 
+%% write token_defs;
+
 #endif