nedgrammar.h

Go to the documentation of this file.
00001 /***************************************************/
00002 /*  File: nedgrammar.h                             */
00003 /*                                                 */
00004 /*  Part of OMNeT++/OMNEST                         */
00005 /*                                                 */
00006 /*  Contents:                                      */
00007 /*    declarations shared by ned.lex and ned.y     */
00008 /*                                                 */
00009 /***************************************************/
00010 
00011 /*--------------------------------------------------------------*
00012   Copyright (C) 2002-2005 Andras Varga
00013 
00014   This file is distributed WITHOUT ANY WARRANTY. See the file
00015   `license' for details on this and other legal matters.
00016 *--------------------------------------------------------------*/
00017 
00018 #ifndef __NEDGRAMMAR_H
00019 #define __NEDGRAMMAR_H
00020 
00021 // define the following if -p (-P) options are in use with bison/flex
00022 #define PARSER_PREFIX_USED
00023 
00024 #ifdef PARSER_PREFIX_USED
00025 
00026 // from lex.yy.cc:
00027 #define yy_create_buffer nedyy_create_buffer
00028 #define yy_delete_buffer nedyy_delete_buffer
00029 #define yy_scan_buffer nedyy_scan_buffer
00030 #define yy_scan_string nedyy_scan_string
00031 #define yy_scan_bytes nedyy_scan_bytes
00032 #define yy_flex_debug nedyy_flex_debug
00033 #define yy_init_buffer nedyy_init_buffer
00034 #define yy_flush_buffer nedyy_flush_buffer
00035 #define yy_load_buffer_state nedyy_load_buffer_state
00036 #define yy_switch_to_buffer nedyy_switch_to_buffer
00037 #define yyin nedyyin
00038 #define yyleng nedyyleng
00039 #define yylex nedyylex
00040 #define yyout nedyyout
00041 #define yyrestart nedyyrestart
00042 #define yytext nedyytext
00043 #define yywrap nedyywrap
00044 
00045 // from ned.tab.cc:
00046 #define yyparse nedyyparse
00047 #define yylex nedyylex
00048 #define yyerror nedyyerror
00049 #define yylval nedyylval
00050 #define yychar nedyychar
00051 #define yydebug nedyydebug
00052 #define yynerrs nedyynerrs
00053 
00054 // only new bisons define the following, but works with older ones (1.28) too
00055 #define yylloc nedyylloc
00056 
00057 #endif
00058 
00059 
00060 class NEDElement;
00061 class NedFileNode;
00062 class NEDParser;
00063 #define YYSTYPE   NEDElement*
00064 
00065 #ifndef YYLTYPE
00066 struct my_yyltype {
00067    int dumy;
00068    int first_line, first_column;
00069    int last_line, last_column;
00070    char *text;
00071 };
00072 #define YYLTYPE  struct my_yyltype
00073 #else
00074 #error 'YYLTYPE defined before ebnf.h -- type clash?'
00075 #endif
00076 
00077 typedef struct {int li; int co;} LineColumn;
00078 
00079 extern LineColumn pos,prevpos;
00080 
00081 extern FILE *yyin;
00082 extern FILE *yyout;
00083 
00084 struct yy_buffer_state;
00085 
00086 struct yy_buffer_state *yy_scan_string(const char *str);
00087 void yy_delete_buffer(struct yy_buffer_state *);
00088 
00089 int runparse (NEDParser *p,NedFileNode *nf,bool parseexpr,bool storesrc, const char *sourcefname);
00090 
00091 extern int use_chanattrname_token;
00092 
00093 #endif
00094 
00095 
00096 

Generated on Sat Oct 21 17:47:58 2006 for OMNeT++/OMNEST NEDXML by  doxygen 1.4.6