File tree 2 files changed +18
-13
lines changed
2 files changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ typedef MC::MC_Parser::token token;
11
11
#define STOKEN ( x ) ( new std::string( x ) )
12
12
13
13
/* define yyterminate as this instead of NULL */
14
- #define yyterminate () return (token::END)
14
+ #define yyterminate () return ( token::END )
15
15
16
16
/* msvc2010 requires that we exclude this header file. */
17
17
#define YY_NO_UNISTD_H
@@ -26,20 +26,24 @@ typedef MC::MC_Parser::token token;
26
26
27
27
%%
28
28
[a -z ] {
29
- return (token::LOWER);
29
+ return ( token::LOWER );
30
30
}
31
+
31
32
[A -Z ] {
32
- return (token::UPPER);
33
+ return ( token::UPPER );
33
34
}
35
+
34
36
[a -zA -Z ]+ {
35
37
yylval->sval = STOKEN ( yytext );
36
- return (token::WORD);
38
+ return ( token::WORD );
37
39
}
40
+
38
41
\n {
39
- return (token::NEWLINE);
42
+ return ( token::NEWLINE );
40
43
}
44
+
41
45
. {
42
- return (token::CHAR);
46
+ return ( token::CHAR );
43
47
}
44
48
%%
45
49
Original file line number Diff line number Diff line change 2
2
%require " 2.5"
3
3
%debug
4
4
%defines
5
- %define namespace " MC "
6
- %define parser_class_name " MC_Parser"
5
+ %define api. namespace {MC}
6
+ %define parser_class_name { MC_Parser}
7
7
8
8
%code requires {
9
9
namespace MC {
69
69
%%
70
70
71
71
72
- void MC::MC_Parser::error ( const MC::MC_Parser::location_type &l,
73
- const std::string &err_message)
72
+ void
73
+ MC::MC_Parser::error ( const std::string &err_message )
74
74
{
75
75
std::cerr << " Error: " << err_message << " \n " ;
76
76
}
77
77
78
78
79
79
/* include for access to scanner.yylex */
80
80
#include " mc_scanner.hpp"
81
- static int yylex (MC::MC_Parser::semantic_type *yylval,
82
- MC::MC_Scanner &scanner,
83
- MC::MC_Driver &driver)
81
+ static int
82
+ yylex ( MC::MC_Parser::semantic_type *yylval,
83
+ MC::MC_Scanner &scanner,
84
+ MC::MC_Driver &driver )
84
85
{
85
86
return ( scanner.yylex (yylval) );
86
87
}
You can’t perform that action at this time.
0 commit comments