From eab295a32f389aca179e211ad4b6999b929b9abc Mon Sep 17 00:00:00 2001 From: guido Date: Tue, 22 Jun 1999 20:18:34 +0000 Subject: [PATCH] Parsing possible git-svn-id: https://svn.dealii.org/trunk@1442 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/parser/dealparse.l | 15 +++++++++++---- deal.II/doc/parser/dealparse.y | 15 +++++++++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/deal.II/doc/parser/dealparse.l b/deal.II/doc/parser/dealparse.l index b66669cadc..87e8908c7c 100644 --- a/deal.II/doc/parser/dealparse.l +++ b/deal.II/doc/parser/dealparse.l @@ -45,9 +45,10 @@ OP \+|\-|\/|\||\^|(==)|(!=)|(<<)|(>>)|(->)|(\+\+)|(\-\-) "*/" { yy_pop_state(); } DeclException[0-9] { yylval = string("@") + string(yytext); return(DECLEXCEPTION); } +"(" { yy_push_state(EXC_IGNORE); } +")" { yy_pop_state(); } . \n -");" { yy_pop_state(); } "//" { yy_push_state(LINECOMMENT); } . @@ -55,9 +56,9 @@ DeclException[0-9] { yylval = string("@") + string(yytext); return(DECLEXCEPTIO /* scan CVS id in file preamble */ -"$Id$" { cvs_id = string(yytext); } -"$Id$" { cvs_id = string(yytext); } -"$Id$" { cvs_id = string(yytext); } +"$Id$]*"$" { cvs_id = string(yytext); } +"$Id$]*"$" { cvs_id = string(yytext); } +"$Id$]*"$" { cvs_id = string(yytext); } /* Ignore function bodies */ @@ -95,6 +96,7 @@ friend { return FRIEND; } typedef { return TYPEDEF; } namespace { return NAMESPACE; } using { return USING; } +long { return LONG; } typename {} {CLASS} { yylval = string(yytext); return CLASS; } @@ -126,6 +128,11 @@ void enterfunction() yy_push_state(INFUNCTION); } +void enterexc() +{ + yy_push_state(EXC_IGNORE); +} + void enterbaseinitializers() { yy_push_state(BASEINIT); diff --git a/deal.II/doc/parser/dealparse.y b/deal.II/doc/parser/dealparse.y index dac843d640..9b8a3920ee 100644 --- a/deal.II/doc/parser/dealparse.y +++ b/deal.II/doc/parser/dealparse.y @@ -13,6 +13,7 @@ stack access_stack; int yylex(); void enterfunction(); +void enterexc(); void enterbaseinitializers(); string doctext; @@ -49,6 +50,7 @@ void yyerror(const char* s) %token OP %token TEMPLATE %token UNSIGNED +%token LONG %token INT %token FLOAT %token CHAR @@ -255,6 +257,7 @@ class_declaration: class_head class_name = class_stack.top() + string("::") + class_name; class_stack.push(class_name); access_stack.push(string("private")); + cout << "@@@" << endl; } '{' class_body '}' { class_stack.pop(); @@ -312,6 +315,7 @@ friend_declaration: vartype: identifier { $$ = $1; } + | LONG IDENTIFIER { $$ = string("long ") + $2; } | UNSIGNED IDENTIFIER { $$ = string("unsigned ") + $2; } | CONST vartype { $$ = string("const ") + $2; } | vartype '*' CONST { $$ = $1 + string("* const"); } @@ -380,11 +384,13 @@ template_declaration: ; deal_exception_declaration: - DECLEXCEPTION '(' IDENTIFIER deal_exception_arglist ')' + DECLEXCEPTION '(' IDENTIFIER { cout << setw(OUTW) << $1 << ':' << $3 << endl << setw(OUTW) << "@In-Class:" << class_stack.top() << endl << setw(OUTW) << "@Access:" << access_stack.top() << endl; - printdoc(cout); } + printdoc(cout); + enterexc(); + } ; deal_exception_arglist: /* empty */ @@ -398,9 +404,10 @@ deal_exception_arg: ; deal_exception_output_declaration: OP - | deal_exception_output_declaration vartype + | expression +/* | deal_exception_output_declaration vartype | deal_exception_output_declaration literal - | deal_exception_output_declaration OP + | deal_exception_output_declaration OP */ ; %% -- 2.39.5