Sha256: 8c1eacacf31df3952d065455aca5a4ff2a3d9bf79fdffbf52d1871e71e681823

Contents?: true

Size: 751 Bytes

Versions: 11

Compression:

Stored size: 751 Bytes

Contents

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

%{
// Prologue

#include "y.tab.h"

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

11 entries across 11 versions & 1 rubygems

Version Path
lrama-0.5.6 sample/parse.y
lrama-0.5.5 sample/parse.y
lrama-0.5.4 sample/parse.y
lrama-0.5.3 sample/parse.y
lrama-0.5.2 sample/parse.y
lrama-0.5.1 sample/parse.y
lrama-0.5.0 sample/parse.y
lrama-0.4.0 sample/parse.y
lrama-0.3.0 sample/parse.y
lrama-0.2.1 sample/parse.y
lrama-0.2.0 sample/parse.y