Sha256: 656eed0f3b84cfe1e477ae614a3f1b215e9c22c48c4ee37fe5a879d430f537d3

Contents?: true

Size: 751 Bytes

Versions: 14

Compression:

Stored size: 751 Bytes

Contents

/*
 * This is comment for this file.
 */

%{
// Prologue
%}

%code provides {

static enum yytokentype yylex(YYSTYPE *lval, YYLTYPE *yylloc);
static void yyerror(YYLTYPE *yylloc, const char *msg);

}

%expect 0
%define api.pure
%define parse.error verbose

%union {
    int i;
}

%token <i> number

%%

program         : expr
                ;

expr            : term '+' expr
                | term
                ;

term            : factor '*' term
                | factor
                ;

factor          : number
                ;

%%

// Epilogue

static enum yytokentype
yylex(YYSTYPE *lval, YYLTYPE *yylloc)
{
    return 0;
}

static void yyerror(YYLTYPE *yylloc, const char *msg)
{
    (void) msg;
}

int main(int argc, char *argv[])
{
}

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
lrama-0.6.9 sample/parse.y
lrama-0.6.8 sample/parse.y
lrama-0.6.7 sample/parse.y
lrama-0.6.6 sample/parse.y
lrama-0.6.5 sample/parse.y
lrama-0.6.4 sample/parse.y
lrama-0.6.3 sample/parse.y
lrama-0.6.2 sample/parse.y
lrama-0.6.1 sample/parse.y
lrama-0.6.0 sample/parse.y
lrama-0.5.12 sample/parse.y
lrama-0.5.11 sample/parse.y
lrama-0.5.10 sample/parse.y
lrama-0.5.9 sample/parse.y