OLD | NEW |
1 /* | 1 /* |
2 Derived from Inferno's utils/iyacc/yacc.c | 2 Derived from Inferno's utils/iyacc/yacc.c |
3 http://code.google.com/p/inferno-os/source/browse/utils/iyacc/yacc.c | 3 http://code.google.com/p/inferno-os/source/browse/utils/iyacc/yacc.c |
4 | 4 |
5 This copyright NOTICE applies to all files in this directory and | 5 This copyright NOTICE applies to all files in this directory and |
6 subdirectories, unless another copyright notice appears in a given | 6 subdirectories, unless another copyright notice appears in a given |
7 file or subdirectory. If you take substantial code from this software to use in | 7 file or subdirectory. If you take substantial code from this software to use in |
8 other programs, you must somehow include with it an appropriate | 8 other programs, you must somehow include with it an appropriate |
9 copyright notice that includes the copyright notice and the other | 9 copyright notice that includes the copyright notice and the other |
10 notices below. It is fine (and often tidier) to do that in a separate | 10 notices below. It is fine (and often tidier) to do that in a separate |
(...skipping 3121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3132 goto out | 3132 goto out |
3133 } | 3133 } |
3134 } | 3134 } |
3135 c = 0 | 3135 c = 0 |
3136 | 3136 |
3137 out: | 3137 out: |
3138 if c == 0 { | 3138 if c == 0 { |
3139 c = yyTok2[1] /* unknown char */ | 3139 c = yyTok2[1] /* unknown char */ |
3140 } | 3140 } |
3141 if yyDebug >= 3 { | 3141 if yyDebug >= 3 { |
3142 » » fmt.Printf("lex %.4x %s\n", uint(yychar), yyTokname(c)) | 3142 » » fmt.Printf("lex %U %s\n", uint(yychar), yyTokname(c)) |
3143 } | 3143 } |
3144 return c | 3144 return c |
3145 } | 3145 } |
3146 | 3146 |
3147 func yyParse(yylex yyLexer) int { | 3147 func yyParse(yylex yyLexer) int { |
3148 var yyn int | 3148 var yyn int |
3149 var yylval yySymType | 3149 var yylval yySymType |
3150 var YYVAL yySymType | 3150 var YYVAL yySymType |
3151 YYS := make([]yySymType, yyMaxDepth) | 3151 YYS := make([]yySymType, yyMaxDepth) |
3152 | 3152 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3298 yystate = yyAct[yyj] | 3298 yystate = yyAct[yyj] |
3299 if yyChk[yystate] != -yyn { | 3299 if yyChk[yystate] != -yyn { |
3300 yystate = yyAct[yyg] | 3300 yystate = yyAct[yyg] |
3301 } | 3301 } |
3302 } | 3302 } |
3303 // dummy call; replaced with literal code | 3303 // dummy call; replaced with literal code |
3304 yyrun() | 3304 yyrun() |
3305 goto yystack /* stack new state and value */ | 3305 goto yystack /* stack new state and value */ |
3306 } | 3306 } |
3307 ` | 3307 ` |
OLD | NEW |