diff --git a/internal/lvgen/.gitignore b/internal/lvgen/.gitignore deleted file mode 100644 index a12bedf..0000000 --- a/internal/lvgen/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore the yacc intermediate files. -y.go -y.output - diff --git a/internal/lvgen/y.go b/internal/lvgen/y.go new file mode 100644 index 0000000..4554414 --- /dev/null +++ b/internal/lvgen/y.go @@ -0,0 +1,747 @@ +//line sunrpc.y:2 +package lvgen + +import __yyfmt__ "fmt" + +//line sunrpc.y:3 +import ( +//"fmt" +) + +//line sunrpc.y:12 +type yySymType struct { + yys int + val string +} + +const BOOL = 57346 +const CASE = 57347 +const CONST = 57348 +const DEFAULT = 57349 +const DOUBLE = 57350 +const ENUM = 57351 +const FLOAT = 57352 +const OPAQUE = 57353 +const STRING = 57354 +const STRUCT = 57355 +const SWITCH = 57356 +const TYPEDEF = 57357 +const UNION = 57358 +const UNSIGNED = 57359 +const VOID = 57360 +const HYPER = 57361 +const INT = 57362 +const SHORT = 57363 +const CHAR = 57364 +const IDENTIFIER = 57365 +const CONSTANT = 57366 +const ERROR = 57367 +const PROGRAM = 57368 +const VERSION = 57369 + +var yyToknames = [...]string{ + "$end", + "error", + "$unk", + "BOOL", + "CASE", + "CONST", + "DEFAULT", + "DOUBLE", + "ENUM", + "FLOAT", + "OPAQUE", + "STRING", + "STRUCT", + "SWITCH", + "TYPEDEF", + "UNION", + "UNSIGNED", + "VOID", + "HYPER", + "INT", + "SHORT", + "CHAR", + "IDENTIFIER", + "CONSTANT", + "ERROR", + "PROGRAM", + "VERSION", + "';'", + "'{'", + "'}'", + "','", + "'='", + "'['", + "']'", + "'<'", + "'>'", + "'*'", + "'('", + "')'", + "':'", +} +var yyStatenames = [...]string{} + +const yyEofCode = 1 +const yyErrCode = 2 +const yyInitialStackSize = 16 + +//line sunrpc.y:222 + +//line yacctab:1 +var yyExca = [...]int{ + -1, 1, + 1, -1, + -2, 0, +} + +const yyPrivate = 57344 + +const yyLast = 148 + +var yyAct = [...]int{ + + 84, 77, 36, 111, 103, 76, 61, 67, 32, 129, + 55, 126, 128, 100, 37, 117, 85, 86, 78, 63, + 98, 97, 73, 31, 74, 69, 131, 115, 71, 89, + 41, 94, 72, 62, 40, 10, 39, 43, 42, 13, + 30, 118, 14, 38, 107, 48, 49, 50, 51, 47, + 90, 11, 79, 64, 10, 70, 106, 96, 13, 54, + 12, 14, 52, 29, 134, 127, 119, 108, 91, 75, + 80, 15, 16, 110, 87, 88, 85, 86, 59, 60, + 63, 93, 83, 48, 49, 50, 51, 92, 95, 58, + 82, 27, 25, 23, 20, 102, 18, 99, 2, 105, + 101, 46, 8, 66, 45, 7, 109, 44, 4, 104, + 113, 105, 114, 116, 120, 28, 122, 81, 8, 68, + 123, 7, 26, 124, 4, 121, 125, 112, 130, 53, + 24, 132, 133, 65, 22, 35, 34, 33, 21, 19, + 57, 56, 17, 9, 6, 5, 3, 1, +} +var yyPact = [...]int{ + + 45, -1000, -1000, 44, -1000, -1000, -1000, -1000, -1000, -1000, + 73, 71, -1000, 70, 69, 68, 45, 34, -1000, 8, + -1000, 26, 33, -1000, -1000, -1000, 30, -1000, -1000, 66, + 55, -1000, -1000, -1000, -1000, -1000, -4, -1000, 64, -1000, + -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, + -1000, -1000, -1000, 89, -2, 25, -3, 0, -1000, -1000, + -1000, -11, 57, -1000, -1000, 26, -20, 22, 42, 67, + -1000, 66, 53, 53, -7, -1000, 20, 40, 26, -1, + -2, 28, -1000, -1000, -1000, -1000, -1000, -13, -16, -1000, + -1000, 26, -26, 57, 53, -1000, 26, -1000, -1000, -1000, + 27, -1000, -1000, 14, 39, 50, 105, -5, 26, -23, + -1000, 11, 38, 53, -1000, 53, -1000, 26, -1000, 105, + -1000, -29, 37, -27, -1000, -31, 26, -1000, -6, 26, + -1000, 53, -1000, 36, -1000, +} +var yyPgo = [...]int{ + + 0, 147, 98, 0, 146, 107, 145, 144, 104, 101, + 143, 142, 10, 141, 140, 139, 138, 1, 8, 137, + 136, 135, 2, 6, 14, 134, 133, 5, 130, 129, + 3, 127, 126, 125, 122, 7, 119, 117, 4, 109, + 106, +} +var yyR1 = [...]int{ + + 0, 1, 3, 3, 2, 2, 4, 4, 4, 4, + 4, 4, 5, 12, 12, 13, 13, 11, 14, 6, + 6, 15, 16, 7, 17, 17, 17, 17, 18, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 24, 24, 24, 24, 23, 19, 20, 20, 21, 26, + 8, 25, 27, 27, 29, 9, 28, 30, 30, 32, + 31, 33, 31, 10, 34, 35, 35, 36, 37, 38, + 38, 39, 40, +} +var yyR2 = [...]int{ + + 0, 1, 1, 1, 2, 3, 1, 1, 1, 1, + 1, 1, 5, 1, 3, 1, 3, 1, 1, 4, + 4, 1, 0, 3, 1, 1, 1, 1, 2, 1, + 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 5, 5, 4, 3, 0, + 6, 1, 2, 3, 0, 10, 1, 2, 3, 0, + 5, 0, 4, 7, 1, 2, 3, 8, 1, 2, + 3, 8, 1, +} +var yyChk = [...]int{ + + -1000, -1, -2, -4, -5, -6, -7, -8, -9, -10, + 9, 6, 15, 13, 16, 26, 28, -11, 23, -15, + 23, -16, -25, 23, -28, 23, -34, 23, -2, 29, + 32, -17, -18, -19, -20, -21, -22, -24, 17, 10, + 8, 4, 12, 11, -5, -8, -9, 23, 19, 20, + 21, 22, 29, -29, 29, -12, -13, -14, 23, 23, + 24, -23, 37, 23, -24, -26, 14, -35, -36, 27, + 30, 31, 32, 33, 35, -23, -27, -17, 38, 30, + 28, -37, 23, -12, -3, 23, 24, -3, -3, 36, + 30, 28, -18, -22, 32, -35, 29, 34, 36, -27, + 39, -23, -3, -38, -39, -22, 29, 30, 28, -40, + 23, -30, -31, 5, 7, 32, -38, 38, 30, 28, + -3, -33, -3, -22, -30, -32, 40, 28, 39, 40, + -17, 32, -17, -3, 28, +} +var yyDef = [...]int{ + + 0, -2, 1, 0, 6, 7, 8, 9, 10, 11, + 0, 0, 22, 0, 0, 0, 4, 0, 17, 0, + 21, 0, 0, 51, 54, 56, 0, 64, 5, 0, + 0, 23, 24, 25, 26, 27, 0, 29, 0, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 49, 0, 0, 0, 13, 15, 18, 19, + 20, 28, 0, 44, 30, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 48, 0, 0, 0, 0, + 65, 0, 68, 14, 16, 2, 3, 0, 0, 47, + 50, 52, 0, 0, 0, 66, 0, 45, 46, 53, + 0, 28, 63, 0, 0, 0, 0, 0, 69, 0, + 72, 0, 0, 0, 61, 0, 70, 0, 55, 57, + 59, 0, 0, 0, 58, 0, 0, 67, 0, 0, + 62, 0, 60, 0, 71, +} +var yyTok1 = [...]int{ + + 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 38, 39, 37, 3, 31, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 40, 28, + 35, 32, 36, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 33, 3, 34, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 29, 3, 30, +} +var yyTok2 = [...]int{ + + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, +} +var yyTok3 = [...]int{ + 0, +} + +var yyErrorMessages = [...]struct { + state int + token int + msg string +}{} + +//line yaccpar:1 + +/* parser for yacc output */ + +var ( + yyDebug = 0 + yyErrorVerbose = false +) + +type yyLexer interface { + Lex(lval *yySymType) int + Error(s string) +} + +type yyParser interface { + Parse(yyLexer) int + Lookahead() int +} + +type yyParserImpl struct { + lval yySymType + stack [yyInitialStackSize]yySymType + char int +} + +func (p *yyParserImpl) Lookahead() int { + return p.char +} + +func yyNewParser() yyParser { + return &yyParserImpl{} +} + +const yyFlag = -1000 + +func yyTokname(c int) string { + if c >= 1 && c-1 < len(yyToknames) { + if yyToknames[c-1] != "" { + return yyToknames[c-1] + } + } + return __yyfmt__.Sprintf("tok-%v", c) +} + +func yyStatname(s int) string { + if s >= 0 && s < len(yyStatenames) { + if yyStatenames[s] != "" { + return yyStatenames[s] + } + } + return __yyfmt__.Sprintf("state-%v", s) +} + +func yyErrorMessage(state, lookAhead int) string { + const TOKSTART = 4 + + if !yyErrorVerbose { + return "syntax error" + } + + for _, e := range yyErrorMessages { + if e.state == state && e.token == lookAhead { + return "syntax error: " + e.msg + } + } + + res := "syntax error: unexpected " + yyTokname(lookAhead) + + // To match Bison, suggest at most four expected tokens. + expected := make([]int, 0, 4) + + // Look for shiftable tokens. + base := yyPact[state] + for tok := TOKSTART; tok-1 < len(yyToknames); tok++ { + if n := base + tok; n >= 0 && n < yyLast && yyChk[yyAct[n]] == tok { + if len(expected) == cap(expected) { + return res + } + expected = append(expected, tok) + } + } + + if yyDef[state] == -2 { + i := 0 + for yyExca[i] != -1 || yyExca[i+1] != state { + i += 2 + } + + // Look for tokens that we accept or reduce. + for i += 2; yyExca[i] >= 0; i += 2 { + tok := yyExca[i] + if tok < TOKSTART || yyExca[i+1] == 0 { + continue + } + if len(expected) == cap(expected) { + return res + } + expected = append(expected, tok) + } + + // If the default action is to accept or reduce, give up. + if yyExca[i+1] != 0 { + return res + } + } + + for i, tok := range expected { + if i == 0 { + res += ", expecting " + } else { + res += " or " + } + res += yyTokname(tok) + } + return res +} + +func yylex1(lex yyLexer, lval *yySymType) (char, token int) { + token = 0 + char = lex.Lex(lval) + if char <= 0 { + token = yyTok1[0] + goto out + } + if char < len(yyTok1) { + token = yyTok1[char] + goto out + } + if char >= yyPrivate { + if char < yyPrivate+len(yyTok2) { + token = yyTok2[char-yyPrivate] + goto out + } + } + for i := 0; i < len(yyTok3); i += 2 { + token = yyTok3[i+0] + if token == char { + token = yyTok3[i+1] + goto out + } + } + +out: + if token == 0 { + token = yyTok2[1] /* unknown char */ + } + if yyDebug >= 3 { + __yyfmt__.Printf("lex %s(%d)\n", yyTokname(token), uint(char)) + } + return char, token +} + +func yyParse(yylex yyLexer) int { + return yyNewParser().Parse(yylex) +} + +func (yyrcvr *yyParserImpl) Parse(yylex yyLexer) int { + var yyn int + var yyVAL yySymType + var yyDollar []yySymType + _ = yyDollar // silence set and not used + yyS := yyrcvr.stack[:] + + Nerrs := 0 /* number of errors */ + Errflag := 0 /* error recovery flag */ + yystate := 0 + yyrcvr.char = -1 + yytoken := -1 // yyrcvr.char translated into internal numbering + defer func() { + // Make sure we report no lookahead when not parsing. + yystate = -1 + yyrcvr.char = -1 + yytoken = -1 + }() + yyp := -1 + goto yystack + +ret0: + return 0 + +ret1: + return 1 + +yystack: + /* put a state and value onto the stack */ + if yyDebug >= 4 { + __yyfmt__.Printf("char %v in %v\n", yyTokname(yytoken), yyStatname(yystate)) + } + + yyp++ + if yyp >= len(yyS) { + nyys := make([]yySymType, len(yyS)*2) + copy(nyys, yyS) + yyS = nyys + } + yyS[yyp] = yyVAL + yyS[yyp].yys = yystate + +yynewstate: + yyn = yyPact[yystate] + if yyn <= yyFlag { + goto yydefault /* simple state */ + } + if yyrcvr.char < 0 { + yyrcvr.char, yytoken = yylex1(yylex, &yyrcvr.lval) + } + yyn += yytoken + if yyn < 0 || yyn >= yyLast { + goto yydefault + } + yyn = yyAct[yyn] + if yyChk[yyn] == yytoken { /* valid shift */ + yyrcvr.char = -1 + yytoken = -1 + yyVAL = yyrcvr.lval + yystate = yyn + if Errflag > 0 { + Errflag-- + } + goto yystack + } + +yydefault: + /* default state action */ + yyn = yyDef[yystate] + if yyn == -2 { + if yyrcvr.char < 0 { + yyrcvr.char, yytoken = yylex1(yylex, &yyrcvr.lval) + } + + /* look through exception table */ + xi := 0 + for { + if yyExca[xi+0] == -1 && yyExca[xi+1] == yystate { + break + } + xi += 2 + } + for xi += 2; ; xi += 2 { + yyn = yyExca[xi+0] + if yyn < 0 || yyn == yytoken { + break + } + } + yyn = yyExca[xi+1] + if yyn < 0 { + goto ret0 + } + } + if yyn == 0 { + /* error ... attempt to resume parsing */ + switch Errflag { + case 0: /* brand new error */ + yylex.Error(yyErrorMessage(yystate, yytoken)) + Nerrs++ + if yyDebug >= 1 { + __yyfmt__.Printf("%s", yyStatname(yystate)) + __yyfmt__.Printf(" saw %s\n", yyTokname(yytoken)) + } + fallthrough + + case 1, 2: /* incompletely recovered error ... try again */ + Errflag = 3 + + /* find a state where "error" is a legal shift action */ + for yyp >= 0 { + yyn = yyPact[yyS[yyp].yys] + yyErrCode + if yyn >= 0 && yyn < yyLast { + yystate = yyAct[yyn] /* simulate a shift of "error" */ + if yyChk[yystate] == yyErrCode { + goto yystack + } + } + + /* the current p has no shift on "error", pop stack */ + if yyDebug >= 2 { + __yyfmt__.Printf("error recovery pops state %d\n", yyS[yyp].yys) + } + yyp-- + } + /* there is no state on the stack with an error shift ... abort */ + goto ret1 + + case 3: /* no shift yet; clobber input char */ + if yyDebug >= 2 { + __yyfmt__.Printf("error recovery discards %s\n", yyTokname(yytoken)) + } + if yytoken == yyEofCode { + goto ret1 + } + yyrcvr.char = -1 + yytoken = -1 + goto yynewstate /* try again in the same state */ + } + } + + /* reduction by production yyn */ + if yyDebug >= 2 { + __yyfmt__.Printf("reduce %v in:\n\t%v\n", yyn, yyStatname(yystate)) + } + + yynt := yyn + yypt := yyp + _ = yypt // guard against "declared and not used" + + yyp -= yyR2[yyn] + // yyp is now the index of $0. Perform the default action. Iff the + // reduced production is ε, $1 is possibly out of range. + if yyp+1 >= len(yyS) { + nyys := make([]yySymType, len(yyS)*2) + copy(nyys, yyS) + yyS = nyys + } + yyVAL = yyS[yyp+1] + + /* consult goto table to find next state */ + yyn = yyR1[yyn] + yyg := yyPgo[yyn] + yyj := yyg + yyS[yyp].yys + 1 + + if yyj >= yyLast { + yystate = yyAct[yyg] + } else { + yystate = yyAct[yyj] + if yyChk[yystate] != -yyn { + yystate = yyAct[yyg] + } + } + // dummy call; replaced with literal code + switch yynt { + + case 12: + yyDollar = yyS[yypt-5 : yypt+1] + //line sunrpc.y:49 + { + StartEnum(yyDollar[2].val) + } + case 15: + yyDollar = yyS[yypt-1 : yypt+1] + //line sunrpc.y:58 + { + err := AddEnumAutoVal(yyDollar[1].val) + if err != nil { + yylex.Error(err.Error()) + return 1 + } + } + case 16: + yyDollar = yyS[yypt-3 : yypt+1] + //line sunrpc.y:65 + { + err := AddEnumVal(yyDollar[1].val, yyDollar[3].val) + if err != nil { + yylex.Error(err.Error()) + return 1 + } + } + case 20: + yyDollar = yyS[yypt-4 : yypt+1] + //line sunrpc.y:87 + { + err := AddConst(yyDollar[2].val, yyDollar[4].val) + if err != nil { + yylex.Error(err.Error()) + return 1 + } + } + case 22: + yyDollar = yyS[yypt-1 : yypt+1] + //line sunrpc.y:101 + { + StartTypedef() + } + case 28: + yyDollar = yyS[yypt-2 : yypt+1] + //line sunrpc.y:112 + { + AddDeclaration(yyDollar[2].val, yyDollar[1].val) + } + case 30: + yyDollar = yyS[yypt-2 : yypt+1] + //line sunrpc.y:117 + { + yyVAL.val = "u" + yyDollar[2].val + } + case 31: + yyDollar = yyS[yypt-1 : yypt+1] + //line sunrpc.y:118 + { + yyVAL.val = "float32" + } + case 32: + yyDollar = yyS[yypt-1 : yypt+1] + //line sunrpc.y:119 + { + yyVAL.val = "float64" + } + case 33: + yyDollar = yyS[yypt-1 : yypt+1] + //line sunrpc.y:120 + { + yyVAL.val = "bool" + } + case 34: + yyDollar = yyS[yypt-1 : yypt+1] + //line sunrpc.y:121 + { + yyVAL.val = "string" + } + case 35: + yyDollar = yyS[yypt-1 : yypt+1] + //line sunrpc.y:122 + { + yyVAL.val = "byte" + } + case 40: + yyDollar = yyS[yypt-1 : yypt+1] + //line sunrpc.y:130 + { + yyVAL.val = "int64" + } + case 41: + yyDollar = yyS[yypt-1 : yypt+1] + //line sunrpc.y:131 + { + yyVAL.val = "int32" + } + case 42: + yyDollar = yyS[yypt-1 : yypt+1] + //line sunrpc.y:132 + { + yyVAL.val = "int16" + } + case 43: + yyDollar = yyS[yypt-1 : yypt+1] + //line sunrpc.y:133 + { + yyVAL.val = "int8" + } + case 45: + yyDollar = yyS[yypt-5 : yypt+1] + //line sunrpc.y:141 + { + AddFixedArray(yyDollar[2].val, yyDollar[1].val, yyDollar[4].val) + } + case 46: + yyDollar = yyS[yypt-5 : yypt+1] + //line sunrpc.y:145 + { + AddVariableArray(yyDollar[2].val, yyDollar[1].val, yyDollar[4].val) + } + case 47: + yyDollar = yyS[yypt-4 : yypt+1] + //line sunrpc.y:146 + { + AddVariableArray(yyDollar[2].val, yyDollar[1].val, "") + } + case 48: + yyDollar = yyS[yypt-3 : yypt+1] + //line sunrpc.y:154 + { + AddVariableArray(yyDollar[3].val, yyDollar[1].val, "1") + } + case 49: + yyDollar = yyS[yypt-3 : yypt+1] + //line sunrpc.y:158 + { + StartStruct(yyDollar[2].val) + } + case 50: + yyDollar = yyS[yypt-6 : yypt+1] + //line sunrpc.y:158 + { + AddStruct() + } + case 54: + yyDollar = yyS[yypt-2 : yypt+1] + //line sunrpc.y:171 + { + StartUnion(yyDollar[2].val) + } + case 55: + yyDollar = yyS[yypt-10 : yypt+1] + //line sunrpc.y:171 + { + AddUnion() + } + case 59: + yyDollar = yyS[yypt-2 : yypt+1] + //line sunrpc.y:184 + { + StartCase(yyDollar[2].val) + } + case 60: + yyDollar = yyS[yypt-5 : yypt+1] + //line sunrpc.y:184 + { + AddCase() + } + case 61: + yyDollar = yyS[yypt-1 : yypt+1] + //line sunrpc.y:185 + { + StartCase("default") + } + case 62: + yyDollar = yyS[yypt-4 : yypt+1] + //line sunrpc.y:185 + { + AddCase() + } + } + goto yystack /* stack new state and value */ +} diff --git a/internal/lvgen/y.output b/internal/lvgen/y.output new file mode 100644 index 0000000..45552f6 --- /dev/null +++ b/internal/lvgen/y.output @@ -0,0 +1,1195 @@ + +state 0 + $accept: .specification $end + + CONST shift 11 + ENUM shift 10 + STRUCT shift 13 + TYPEDEF shift 12 + UNION shift 14 + PROGRAM shift 15 + . error + + specification goto 1 + definition_list goto 2 + definition goto 3 + enum_definition goto 4 + const_definition goto 5 + typedef_definition goto 6 + struct_definition goto 7 + union_definition goto 8 + program_definition goto 9 + +state 1 + $accept: specification.$end + + $end accept + . error + + +state 2 + specification: definition_list. (1) + + . reduce 1 (src line 25) + + +state 3 + definition_list: definition.';' + definition_list: definition.';' definition_list + + ';' shift 16 + . error + + +state 4 + definition: enum_definition. (6) + + . reduce 6 (src line 39) + + +state 5 + definition: const_definition. (7) + + . reduce 7 (src line 41) + + +state 6 + definition: typedef_definition. (8) + + . reduce 8 (src line 42) + + +state 7 + definition: struct_definition. (9) + + . reduce 9 (src line 43) + + +state 8 + definition: union_definition. (10) + + . reduce 10 (src line 44) + + +state 9 + definition: program_definition. (11) + + . reduce 11 (src line 45) + + +state 10 + enum_definition: ENUM.enum_ident '{' enum_value_list '}' + + IDENTIFIER shift 18 + . error + + enum_ident goto 17 + +state 11 + const_definition: CONST.const_ident '=' IDENTIFIER + const_definition: CONST.const_ident '=' CONSTANT + + IDENTIFIER shift 20 + . error + + const_ident goto 19 + +state 12 + typedef_definition: TYPEDEF.$$22 declaration + $$22: . (22) + + . reduce 22 (src line 100) + + $$22 goto 21 + +state 13 + struct_definition: STRUCT.struct_ident '{' $$49 declaration_list '}' + + IDENTIFIER shift 23 + . error + + struct_ident goto 22 + +state 14 + union_definition: UNION.union_ident $$54 SWITCH '(' simple_declaration ')' '{' case_list '}' + + IDENTIFIER shift 25 + . error + + union_ident goto 24 + +state 15 + program_definition: PROGRAM.program_ident '{' version_list '}' '=' value + + IDENTIFIER shift 27 + . error + + program_ident goto 26 + +state 16 + definition_list: definition ';'. (4) + definition_list: definition ';'.definition_list + + CONST shift 11 + ENUM shift 10 + STRUCT shift 13 + TYPEDEF shift 12 + UNION shift 14 + PROGRAM shift 15 + . reduce 4 (src line 34) + + definition_list goto 28 + definition goto 3 + enum_definition goto 4 + const_definition goto 5 + typedef_definition goto 6 + struct_definition goto 7 + union_definition goto 8 + program_definition goto 9 + +state 17 + enum_definition: ENUM enum_ident.'{' enum_value_list '}' + + '{' shift 29 + . error + + +state 18 + enum_ident: IDENTIFIER. (17) + + . reduce 17 (src line 74) + + +state 19 + const_definition: CONST const_ident.'=' IDENTIFIER + const_definition: CONST const_ident.'=' CONSTANT + + '=' shift 30 + . error + + +state 20 + const_ident: IDENTIFIER. (21) + + . reduce 21 (src line 96) + + +state 21 + typedef_definition: TYPEDEF $$22.declaration + + BOOL shift 41 + DOUBLE shift 40 + ENUM shift 10 + FLOAT shift 39 + OPAQUE shift 43 + STRING shift 42 + STRUCT shift 13 + UNION shift 14 + UNSIGNED shift 38 + HYPER shift 48 + INT shift 49 + SHORT shift 50 + CHAR shift 51 + IDENTIFIER shift 47 + . error + + enum_definition goto 44 + struct_definition goto 45 + union_definition goto 46 + declaration goto 31 + simple_declaration goto 32 + fixed_array_declaration goto 33 + variable_array_declaration goto 34 + pointer_declaration goto 35 + type_specifier goto 36 + int_spec goto 37 + +state 22 + struct_definition: STRUCT struct_ident.'{' $$49 declaration_list '}' + + '{' shift 52 + . error + + +state 23 + struct_ident: IDENTIFIER. (51) + + . reduce 51 (src line 161) + + +state 24 + union_definition: UNION union_ident.$$54 SWITCH '(' simple_declaration ')' '{' case_list '}' + $$54: . (54) + + . reduce 54 (src line 170) + + $$54 goto 53 + +state 25 + union_ident: IDENTIFIER. (56) + + . reduce 56 (src line 174) + + +state 26 + program_definition: PROGRAM program_ident.'{' version_list '}' '=' value + + '{' shift 54 + . error + + +state 27 + program_ident: IDENTIFIER. (64) + + . reduce 64 (src line 192) + + +state 28 + definition_list: definition ';' definition_list. (5) + + . reduce 5 (src line 36) + + +state 29 + enum_definition: ENUM enum_ident '{'.enum_value_list '}' + + IDENTIFIER shift 58 + . error + + enum_value_list goto 55 + enum_value goto 56 + enum_value_ident goto 57 + +state 30 + const_definition: CONST const_ident '='.IDENTIFIER + const_definition: CONST const_ident '='.CONSTANT + + IDENTIFIER shift 59 + CONSTANT shift 60 + . error + + +state 31 + typedef_definition: TYPEDEF $$22 declaration. (23) + + . reduce 23 (src line 101) + + +state 32 + declaration: simple_declaration. (24) + + . reduce 24 (src line 104) + + +state 33 + declaration: fixed_array_declaration. (25) + + . reduce 25 (src line 106) + + +state 34 + declaration: variable_array_declaration. (26) + + . reduce 26 (src line 107) + + +state 35 + declaration: pointer_declaration. (27) + + . reduce 27 (src line 108) + + +state 36 + simple_declaration: type_specifier.variable_ident + fixed_array_declaration: type_specifier.variable_ident '[' value ']' + variable_array_declaration: type_specifier.variable_ident '<' value '>' + variable_array_declaration: type_specifier.variable_ident '<' '>' + pointer_declaration: type_specifier.'*' variable_ident + + IDENTIFIER shift 63 + '*' shift 62 + . error + + variable_ident goto 61 + +state 37 + type_specifier: int_spec. (29) + + . reduce 29 (src line 115) + + +state 38 + type_specifier: UNSIGNED.int_spec + + HYPER shift 48 + INT shift 49 + SHORT shift 50 + CHAR shift 51 + . error + + int_spec goto 64 + +state 39 + type_specifier: FLOAT. (31) + + . reduce 31 (src line 118) + + +state 40 + type_specifier: DOUBLE. (32) + + . reduce 32 (src line 119) + + +state 41 + type_specifier: BOOL. (33) + + . reduce 33 (src line 120) + + +state 42 + type_specifier: STRING. (34) + + . reduce 34 (src line 121) + + +state 43 + type_specifier: OPAQUE. (35) + + . reduce 35 (src line 122) + + +state 44 + type_specifier: enum_definition. (36) + + . reduce 36 (src line 123) + + +state 45 + type_specifier: struct_definition. (37) + + . reduce 37 (src line 124) + + +state 46 + type_specifier: union_definition. (38) + + . reduce 38 (src line 125) + + +state 47 + type_specifier: IDENTIFIER. (39) + + . reduce 39 (src line 126) + + +state 48 + int_spec: HYPER. (40) + + . reduce 40 (src line 129) + + +state 49 + int_spec: INT. (41) + + . reduce 41 (src line 131) + + +state 50 + int_spec: SHORT. (42) + + . reduce 42 (src line 132) + + +state 51 + int_spec: CHAR. (43) + + . reduce 43 (src line 133) + + +state 52 + struct_definition: STRUCT struct_ident '{'.$$49 declaration_list '}' + $$49: . (49) + + . reduce 49 (src line 157) + + $$49 goto 65 + +state 53 + union_definition: UNION union_ident $$54.SWITCH '(' simple_declaration ')' '{' case_list '}' + + SWITCH shift 66 + . error + + +state 54 + program_definition: PROGRAM program_ident '{'.version_list '}' '=' value + + VERSION shift 69 + . error + + version_list goto 67 + version goto 68 + +state 55 + enum_definition: ENUM enum_ident '{' enum_value_list.'}' + + '}' shift 70 + . error + + +state 56 + enum_value_list: enum_value. (13) + enum_value_list: enum_value.',' enum_value_list + + ',' shift 71 + . reduce 13 (src line 52) + + +state 57 + enum_value: enum_value_ident. (15) + enum_value: enum_value_ident.'=' value + + '=' shift 72 + . reduce 15 (src line 57) + + +state 58 + enum_value_ident: IDENTIFIER. (18) + + . reduce 18 (src line 78) + + +state 59 + const_definition: CONST const_ident '=' IDENTIFIER. (19) + + . reduce 19 (src line 85) + + +state 60 + const_definition: CONST const_ident '=' CONSTANT. (20) + + . reduce 20 (src line 87) + + +state 61 + simple_declaration: type_specifier variable_ident. (28) + fixed_array_declaration: type_specifier variable_ident.'[' value ']' + variable_array_declaration: type_specifier variable_ident.'<' value '>' + variable_array_declaration: type_specifier variable_ident.'<' '>' + + '[' shift 73 + '<' shift 74 + . reduce 28 (src line 111) + + +state 62 + pointer_declaration: type_specifier '*'.variable_ident + + IDENTIFIER shift 63 + . error + + variable_ident goto 75 + +state 63 + variable_ident: IDENTIFIER. (44) + + . reduce 44 (src line 136) + + +state 64 + type_specifier: UNSIGNED int_spec. (30) + + . reduce 30 (src line 117) + + +state 65 + struct_definition: STRUCT struct_ident '{' $$49.declaration_list '}' + + BOOL shift 41 + DOUBLE shift 40 + ENUM shift 10 + FLOAT shift 39 + OPAQUE shift 43 + STRING shift 42 + STRUCT shift 13 + UNION shift 14 + UNSIGNED shift 38 + HYPER shift 48 + INT shift 49 + SHORT shift 50 + CHAR shift 51 + IDENTIFIER shift 47 + . error + + enum_definition goto 44 + struct_definition goto 45 + union_definition goto 46 + declaration goto 77 + simple_declaration goto 32 + fixed_array_declaration goto 33 + variable_array_declaration goto 34 + pointer_declaration goto 35 + type_specifier goto 36 + int_spec goto 37 + declaration_list goto 76 + +state 66 + union_definition: UNION union_ident $$54 SWITCH.'(' simple_declaration ')' '{' case_list '}' + + '(' shift 78 + . error + + +state 67 + program_definition: PROGRAM program_ident '{' version_list.'}' '=' value + + '}' shift 79 + . error + + +state 68 + version_list: version.';' + version_list: version.';' version_list + + ';' shift 80 + . error + + +state 69 + version: VERSION.version_ident '{' procedure_list '}' '=' value ';' + + IDENTIFIER shift 82 + . error + + version_ident goto 81 + +state 70 + enum_definition: ENUM enum_ident '{' enum_value_list '}'. (12) + + . reduce 12 (src line 48) + + +state 71 + enum_value_list: enum_value ','.enum_value_list + + IDENTIFIER shift 58 + . error + + enum_value_list goto 83 + enum_value goto 56 + enum_value_ident goto 57 + +state 72 + enum_value: enum_value_ident '='.value + + IDENTIFIER shift 85 + CONSTANT shift 86 + . error + + value goto 84 + +state 73 + fixed_array_declaration: type_specifier variable_ident '['.value ']' + + IDENTIFIER shift 85 + CONSTANT shift 86 + . error + + value goto 87 + +state 74 + variable_array_declaration: type_specifier variable_ident '<'.value '>' + variable_array_declaration: type_specifier variable_ident '<'.'>' + + IDENTIFIER shift 85 + CONSTANT shift 86 + '>' shift 89 + . error + + value goto 88 + +state 75 + pointer_declaration: type_specifier '*' variable_ident. (48) + + . reduce 48 (src line 153) + + +state 76 + struct_definition: STRUCT struct_ident '{' $$49 declaration_list.'}' + + '}' shift 90 + . error + + +state 77 + declaration_list: declaration.';' + declaration_list: declaration.';' declaration_list + + ';' shift 91 + . error + + +state 78 + union_definition: UNION union_ident $$54 SWITCH '('.simple_declaration ')' '{' case_list '}' + + BOOL shift 41 + DOUBLE shift 40 + ENUM shift 10 + FLOAT shift 39 + OPAQUE shift 43 + STRING shift 42 + STRUCT shift 13 + UNION shift 14 + UNSIGNED shift 38 + HYPER shift 48 + INT shift 49 + SHORT shift 50 + CHAR shift 51 + IDENTIFIER shift 47 + . error + + enum_definition goto 44 + struct_definition goto 45 + union_definition goto 46 + simple_declaration goto 92 + type_specifier goto 93 + int_spec goto 37 + +state 79 + program_definition: PROGRAM program_ident '{' version_list '}'.'=' value + + '=' shift 94 + . error + + +state 80 + version_list: version ';'. (65) + version_list: version ';'.version_list + + VERSION shift 69 + . reduce 65 (src line 196) + + version_list goto 95 + version goto 68 + +state 81 + version: VERSION version_ident.'{' procedure_list '}' '=' value ';' + + '{' shift 96 + . error + + +state 82 + version_ident: IDENTIFIER. (68) + + . reduce 68 (src line 205) + + +state 83 + enum_value_list: enum_value ',' enum_value_list. (14) + + . reduce 14 (src line 54) + + +state 84 + enum_value: enum_value_ident '=' value. (16) + + . reduce 16 (src line 65) + + +state 85 + value: IDENTIFIER. (2) + + . reduce 2 (src line 29) + + +state 86 + value: CONSTANT. (3) + + . reduce 3 (src line 31) + + +state 87 + fixed_array_declaration: type_specifier variable_ident '[' value.']' + + ']' shift 97 + . error + + +state 88 + variable_array_declaration: type_specifier variable_ident '<' value.'>' + + '>' shift 98 + . error + + +state 89 + variable_array_declaration: type_specifier variable_ident '<' '>'. (47) + + . reduce 47 (src line 146) + + +state 90 + struct_definition: STRUCT struct_ident '{' $$49 declaration_list '}'. (50) + + . reduce 50 (src line 158) + + +state 91 + declaration_list: declaration ';'. (52) + declaration_list: declaration ';'.declaration_list + + BOOL shift 41 + DOUBLE shift 40 + ENUM shift 10 + FLOAT shift 39 + OPAQUE shift 43 + STRING shift 42 + STRUCT shift 13 + UNION shift 14 + UNSIGNED shift 38 + HYPER shift 48 + INT shift 49 + SHORT shift 50 + CHAR shift 51 + IDENTIFIER shift 47 + . reduce 52 (src line 165) + + enum_definition goto 44 + struct_definition goto 45 + union_definition goto 46 + declaration goto 77 + simple_declaration goto 32 + fixed_array_declaration goto 33 + variable_array_declaration goto 34 + pointer_declaration goto 35 + type_specifier goto 36 + int_spec goto 37 + declaration_list goto 99 + +state 92 + union_definition: UNION union_ident $$54 SWITCH '(' simple_declaration.')' '{' case_list '}' + + ')' shift 100 + . error + + +state 93 + simple_declaration: type_specifier.variable_ident + + IDENTIFIER shift 63 + . error + + variable_ident goto 101 + +state 94 + program_definition: PROGRAM program_ident '{' version_list '}' '='.value + + IDENTIFIER shift 85 + CONSTANT shift 86 + . error + + value goto 102 + +state 95 + version_list: version ';' version_list. (66) + + . reduce 66 (src line 198) + + +state 96 + version: VERSION version_ident '{'.procedure_list '}' '=' value ';' + + BOOL shift 41 + DOUBLE shift 40 + ENUM shift 10 + FLOAT shift 39 + OPAQUE shift 43 + STRING shift 42 + STRUCT shift 13 + UNION shift 14 + UNSIGNED shift 38 + HYPER shift 48 + INT shift 49 + SHORT shift 50 + CHAR shift 51 + IDENTIFIER shift 47 + . error + + enum_definition goto 44 + struct_definition goto 45 + union_definition goto 46 + type_specifier goto 105 + int_spec goto 37 + procedure_list goto 103 + procedure goto 104 + +state 97 + fixed_array_declaration: type_specifier variable_ident '[' value ']'. (45) + + . reduce 45 (src line 140) + + +state 98 + variable_array_declaration: type_specifier variable_ident '<' value '>'. (46) + + . reduce 46 (src line 144) + + +state 99 + declaration_list: declaration ';' declaration_list. (53) + + . reduce 53 (src line 167) + + +state 100 + union_definition: UNION union_ident $$54 SWITCH '(' simple_declaration ')'.'{' case_list '}' + + '{' shift 106 + . error + + +state 101 + simple_declaration: type_specifier variable_ident. (28) + + . reduce 28 (src line 111) + + +state 102 + program_definition: PROGRAM program_ident '{' version_list '}' '=' value. (63) + + . reduce 63 (src line 188) + + +state 103 + version: VERSION version_ident '{' procedure_list.'}' '=' value ';' + + '}' shift 107 + . error + + +state 104 + procedure_list: procedure.';' + procedure_list: procedure.';' procedure_list + + ';' shift 108 + . error + + +state 105 + procedure: type_specifier.procedure_ident '(' type_specifier ')' '=' value ';' + + IDENTIFIER shift 110 + . error + + procedure_ident goto 109 + +state 106 + union_definition: UNION union_ident $$54 SWITCH '(' simple_declaration ')' '{'.case_list '}' + + CASE shift 113 + DEFAULT shift 114 + . error + + case_list goto 111 + case goto 112 + +state 107 + version: VERSION version_ident '{' procedure_list '}'.'=' value ';' + + '=' shift 115 + . error + + +state 108 + procedure_list: procedure ';'. (69) + procedure_list: procedure ';'.procedure_list + + BOOL shift 41 + DOUBLE shift 40 + ENUM shift 10 + FLOAT shift 39 + OPAQUE shift 43 + STRING shift 42 + STRUCT shift 13 + UNION shift 14 + UNSIGNED shift 38 + HYPER shift 48 + INT shift 49 + SHORT shift 50 + CHAR shift 51 + IDENTIFIER shift 47 + . reduce 69 (src line 209) + + enum_definition goto 44 + struct_definition goto 45 + union_definition goto 46 + type_specifier goto 105 + int_spec goto 37 + procedure_list goto 116 + procedure goto 104 + +state 109 + procedure: type_specifier procedure_ident.'(' type_specifier ')' '=' value ';' + + '(' shift 117 + . error + + +state 110 + procedure_ident: IDENTIFIER. (72) + + . reduce 72 (src line 218) + + +state 111 + union_definition: UNION union_ident $$54 SWITCH '(' simple_declaration ')' '{' case_list.'}' + + '}' shift 118 + . error + + +state 112 + case_list: case.';' + case_list: case.';' case_list + + ';' shift 119 + . error + + +state 113 + case: CASE.value $$59 ':' declaration + + IDENTIFIER shift 85 + CONSTANT shift 86 + . error + + value goto 120 + +state 114 + case: DEFAULT.$$61 ':' declaration + $$61: . (61) + + . reduce 61 (src line 185) + + $$61 goto 121 + +state 115 + version: VERSION version_ident '{' procedure_list '}' '='.value ';' + + IDENTIFIER shift 85 + CONSTANT shift 86 + . error + + value goto 122 + +state 116 + procedure_list: procedure ';' procedure_list. (70) + + . reduce 70 (src line 211) + + +state 117 + procedure: type_specifier procedure_ident '('.type_specifier ')' '=' value ';' + + BOOL shift 41 + DOUBLE shift 40 + ENUM shift 10 + FLOAT shift 39 + OPAQUE shift 43 + STRING shift 42 + STRUCT shift 13 + UNION shift 14 + UNSIGNED shift 38 + HYPER shift 48 + INT shift 49 + SHORT shift 50 + CHAR shift 51 + IDENTIFIER shift 47 + . error + + enum_definition goto 44 + struct_definition goto 45 + union_definition goto 46 + type_specifier goto 123 + int_spec goto 37 + +state 118 + union_definition: UNION union_ident $$54 SWITCH '(' simple_declaration ')' '{' case_list '}'. (55) + + . reduce 55 (src line 171) + + +state 119 + case_list: case ';'. (57) + case_list: case ';'.case_list + + CASE shift 113 + DEFAULT shift 114 + . reduce 57 (src line 178) + + case_list goto 124 + case goto 112 + +state 120 + case: CASE value.$$59 ':' declaration + $$59: . (59) + + . reduce 59 (src line 183) + + $$59 goto 125 + +state 121 + case: DEFAULT $$61.':' declaration + + ':' shift 126 + . error + + +state 122 + version: VERSION version_ident '{' procedure_list '}' '=' value.';' + + ';' shift 127 + . error + + +state 123 + procedure: type_specifier procedure_ident '(' type_specifier.')' '=' value ';' + + ')' shift 128 + . error + + +state 124 + case_list: case ';' case_list. (58) + + . reduce 58 (src line 180) + + +state 125 + case: CASE value $$59.':' declaration + + ':' shift 129 + . error + + +state 126 + case: DEFAULT $$61 ':'.declaration + + BOOL shift 41 + DOUBLE shift 40 + ENUM shift 10 + FLOAT shift 39 + OPAQUE shift 43 + STRING shift 42 + STRUCT shift 13 + UNION shift 14 + UNSIGNED shift 38 + HYPER shift 48 + INT shift 49 + SHORT shift 50 + CHAR shift 51 + IDENTIFIER shift 47 + . error + + enum_definition goto 44 + struct_definition goto 45 + union_definition goto 46 + declaration goto 130 + simple_declaration goto 32 + fixed_array_declaration goto 33 + variable_array_declaration goto 34 + pointer_declaration goto 35 + type_specifier goto 36 + int_spec goto 37 + +state 127 + version: VERSION version_ident '{' procedure_list '}' '=' value ';'. (67) + + . reduce 67 (src line 201) + + +state 128 + procedure: type_specifier procedure_ident '(' type_specifier ')'.'=' value ';' + + '=' shift 131 + . error + + +state 129 + case: CASE value $$59 ':'.declaration + + BOOL shift 41 + DOUBLE shift 40 + ENUM shift 10 + FLOAT shift 39 + OPAQUE shift 43 + STRING shift 42 + STRUCT shift 13 + UNION shift 14 + UNSIGNED shift 38 + HYPER shift 48 + INT shift 49 + SHORT shift 50 + CHAR shift 51 + IDENTIFIER shift 47 + . error + + enum_definition goto 44 + struct_definition goto 45 + union_definition goto 46 + declaration goto 132 + simple_declaration goto 32 + fixed_array_declaration goto 33 + variable_array_declaration goto 34 + pointer_declaration goto 35 + type_specifier goto 36 + int_spec goto 37 + +state 130 + case: DEFAULT $$61 ':' declaration. (62) + + . reduce 62 (src line 185) + + +state 131 + procedure: type_specifier procedure_ident '(' type_specifier ')' '='.value ';' + + IDENTIFIER shift 85 + CONSTANT shift 86 + . error + + value goto 133 + +state 132 + case: CASE value $$59 ':' declaration. (60) + + . reduce 60 (src line 184) + + +state 133 + procedure: type_specifier procedure_ident '(' type_specifier ')' '=' value.';' + + ';' shift 134 + . error + + +state 134 + procedure: type_specifier procedure_ident '(' type_specifier ')' '=' value ';'. (71) + + . reduce 71 (src line 214) + + +40 terminals, 41 nonterminals +73 grammar rules, 135/8000 states +0 shift/reduce, 0 reduce/reduce conflicts reported +90 working sets used +memory: parser 155/120000 +40 extra closures +212 shift entries, 1 exceptions +69 goto entries +62 entries saved by goto default +Optimizer space used: output 148/120000 +148 table entries, 0 zero +maximum spread: 40, maximum offset: 131