Skip to content

Commit bdd007a

Browse files
updates
1 parent fe04642 commit bdd007a

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

mc_lexer.l

+10-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ typedef MC::MC_Parser::token token;
1111
#define STOKEN( x ) ( new std::string( x ) )
1212

1313
/* define yyterminate as this instead of NULL */
14-
#define yyterminate() return(token::END)
14+
#define yyterminate() return( token::END )
1515

1616
/* msvc2010 requires that we exclude this header file. */
1717
#define YY_NO_UNISTD_H
@@ -26,20 +26,24 @@ typedef MC::MC_Parser::token token;
2626

2727
%%
2828
[a-z] {
29-
return(token::LOWER);
29+
return( token::LOWER );
3030
}
31+
3132
[A-Z] {
32-
return(token::UPPER);
33+
return( token::UPPER );
3334
}
35+
3436
[a-zA-Z]+ {
3537
yylval->sval = STOKEN( yytext );
36-
return(token::WORD);
38+
return( token::WORD );
3739
}
40+
3841
\n {
39-
return(token::NEWLINE);
42+
return( token::NEWLINE );
4043
}
44+
4145
. {
42-
return(token::CHAR);
46+
return( token::CHAR );
4347
}
4448
%%
4549

mc_parser.yy

+8-7
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
%require "2.5"
33
%debug
44
%defines
5-
%define namespace "MC"
6-
%define parser_class_name "MC_Parser"
5+
%define api.namespace {MC}
6+
%define parser_class_name {MC_Parser}
77

88
%code requires{
99
namespace MC {
@@ -69,18 +69,19 @@ item
6969
%%
7070

7171

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 )
7474
{
7575
std::cerr << "Error: " << err_message << "\n";
7676
}
7777

7878

7979
/* include for access to scanner.yylex */
8080
#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 )
8485
{
8586
return( scanner.yylex(yylval) );
8687
}

0 commit comments

Comments
 (0)