_vs1.0_parser.cpp 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868
  1. /*
  2. -----------------------------------------------------------------------------
  3. This source file is part of OGRE
  4. (Object-oriented Graphics Rendering Engine)
  5. For the latest info, see http://www.ogre3d.org/
  6. Copyright (c) 2000-2011 Torus Knot Software Ltd
  7. Permission is hereby granted, free of charge, to any person obtaining a copy
  8. of this software and associated documentation files (the "Software"), to deal
  9. in the Software without restriction, including without limitation the rights
  10. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11. copies of the Software, and to permit persons to whom the Software is
  12. furnished to do so, subject to the following conditions:
  13. The above copyright notice and this permission notice shall be included in
  14. all copies or substantial portions of the Software.
  15. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21. THE SOFTWARE.
  22. -----------------------------------------------------------------------------
  23. */
  24. /* A Bison parser, made by GNU Bison 1.875. */
  25. /* Skeleton parser for Yacc-like parsing with Bison,
  26. Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
  27. This program is free software; you can redistribute it and/or modify
  28. it under the terms of the GNU General Public License as published by
  29. the Free Software Foundation; either version 2, or (at your option)
  30. any later version.
  31. This program is distributed in the hope that it will be useful,
  32. but WITHOUT ANY WARRANTY; without even the implied warranty of
  33. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  34. GNU General Public License for more details.
  35. You should have received a copy of the GNU General Public License
  36. along with this program; if not, write to the Free Software
  37. Foundation, Inc., 59 Temple Place - Suite 330,
  38. Boston, MA 02111-1307, USA. */
  39. /* As a special exception, when this file is copied by Bison into a
  40. Bison output file, you may use that output file without restriction.
  41. This special exception was added by the Free Software Foundation
  42. in version 1.24 of Bison. */
  43. /* Written by Richard Stallman by simplifying the original so called
  44. ``semantic'' parser. */
  45. /* All symbols defined below should begin with yy or YY, to avoid
  46. infringing on user name space. This should be done even for local
  47. variables, as they might otherwise be expanded by user macros.
  48. There are some unavoidable exceptions within include files to
  49. define necessary library symbols; they are noted "INFRINGES ON
  50. USER NAME SPACE" below. */
  51. /* Identify Bison output. */
  52. #define YYBISON 1
  53. /* Skeleton name. */
  54. #define YYSKELETON_NAME "yacc.c"
  55. /* Pure parsers. */
  56. #define YYPURE 0
  57. /* Using locations. */
  58. #define YYLSP_NEEDED 0
  59. /* If NAME_PREFIX is specified substitute the variables and functions
  60. names. */
  61. #define yyparse vs10_parse
  62. #define yylex vs10_lex
  63. #define yyerror vs10_error
  64. #define yylval vs10_lval
  65. #define yychar vs10_char
  66. #define yydebug vs10_debug
  67. #define yynerrs vs10_nerrs
  68. /* Tokens. */
  69. #ifndef YYTOKENTYPE
  70. # define YYTOKENTYPE
  71. /* Put the tokens into the symbol table, so that GDB and other debuggers
  72. know about them. */
  73. enum yytokentype {
  74. VERTEX_SHADER = 258,
  75. ADD_INSTR = 259,
  76. DP3_INSTR = 260,
  77. DP4_INSTR = 261,
  78. DST_INSTR = 262,
  79. EXP_INSTR = 263,
  80. EXPP_INSTR = 264,
  81. FRC_INSTR = 265,
  82. LIT_INSTR = 266,
  83. LOG_INSTR = 267,
  84. LOGP_INSTR = 268,
  85. M3X2_INSTR = 269,
  86. M3X3_INSTR = 270,
  87. M3X4_INSTR = 271,
  88. M4X3_INSTR = 272,
  89. M4X4_INSTR = 273,
  90. MAD_INSTR = 274,
  91. MAX_INSTR = 275,
  92. MIN_INSTR = 276,
  93. MOV_INSTR = 277,
  94. MUL_INSTR = 278,
  95. NOP_INSTR = 279,
  96. RCP_INSTR = 280,
  97. RSQ_INSTR = 281,
  98. SGE_INSTR = 282,
  99. SLT_INSTR = 283,
  100. SUB_INSTR = 284,
  101. ILLEGAL = 285,
  102. UNKNOWN_STRING = 286,
  103. INTVAL = 287,
  104. REGISTER = 288,
  105. XYZW_MODIFIER = 289,
  106. COMMENT = 290
  107. };
  108. #endif
  109. #define VERTEX_SHADER 258
  110. #define ADD_INSTR 259
  111. #define DP3_INSTR 260
  112. #define DP4_INSTR 261
  113. #define DST_INSTR 262
  114. #define EXP_INSTR 263
  115. #define EXPP_INSTR 264
  116. #define FRC_INSTR 265
  117. #define LIT_INSTR 266
  118. #define LOG_INSTR 267
  119. #define LOGP_INSTR 268
  120. #define M3X2_INSTR 269
  121. #define M3X3_INSTR 270
  122. #define M3X4_INSTR 271
  123. #define M4X3_INSTR 272
  124. #define M4X4_INSTR 273
  125. #define MAD_INSTR 274
  126. #define MAX_INSTR 275
  127. #define MIN_INSTR 276
  128. #define MOV_INSTR 277
  129. #define MUL_INSTR 278
  130. #define NOP_INSTR 279
  131. #define RCP_INSTR 280
  132. #define RSQ_INSTR 281
  133. #define SGE_INSTR 282
  134. #define SLT_INSTR 283
  135. #define SUB_INSTR 284
  136. #define ILLEGAL 285
  137. #define UNKNOWN_STRING 286
  138. #define INTVAL 287
  139. #define REGISTER 288
  140. #define XYZW_MODIFIER 289
  141. #define COMMENT 290
  142. /* Copy the first part of user declarations. */
  143. #line 3 "vs1.0_grammar.y"
  144. void yyerror(const char *s);
  145. int yylex(void);
  146. #include <math.h>
  147. #include <string>
  148. #include <stdlib.h>
  149. #include "vs1.0_inst_list.h"
  150. #include "nvparse_errors.h"
  151. #include "nvparse_externs.h"
  152. //extern bool gbTempInsideMacro;
  153. //extern unsigned int &base_linenumber;
  154. void LexError(const char *format, ...);
  155. extern int line_incr;
  156. #define do_linenum_incr() { line_number+=line_incr; line_incr = 0; }
  157. //int get_linenum() { return( gbTempInsideMacro ? base_linenumber : line_number ); }
  158. int get_linenum() { return( line_number ); }
  159. #define YYDEBUG 1
  160. /* Enabling traces. */
  161. #ifndef YYDEBUG
  162. # define YYDEBUG 0
  163. #endif
  164. /* Enabling verbose error messages. */
  165. #ifdef YYERROR_VERBOSE
  166. # undef YYERROR_VERBOSE
  167. # define YYERROR_VERBOSE 1
  168. #else
  169. # define YYERROR_VERBOSE 0
  170. #endif
  171. #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
  172. #line 27 "vs1.0_grammar.y"
  173. typedef union YYSTYPE {
  174. int ival;
  175. unsigned int lval;
  176. float fval;
  177. char mask[4];
  178. char *comment;
  179. VS10Reg reg;
  180. VS10InstPtr inst;
  181. VS10InstListPtr instList;
  182. } YYSTYPE;
  183. /* Line 191 of yacc.c. */
  184. #line 190 "_vs1.0_parser.c"
  185. # define yystype YYSTYPE /* obsolescent; will be withdrawn */
  186. # define YYSTYPE_IS_DECLARED 1
  187. # define YYSTYPE_IS_TRIVIAL 1
  188. #endif
  189. /* Copy the second part of user declarations. */
  190. /* Line 214 of yacc.c. */
  191. #line 202 "_vs1.0_parser.c"
  192. #if ! defined (yyoverflow) || YYERROR_VERBOSE
  193. /* The parser invokes alloca or malloc; define the necessary symbols. */
  194. # if YYSTACK_USE_ALLOCA
  195. # define YYSTACK_ALLOC alloca
  196. # else
  197. # ifndef YYSTACK_USE_ALLOCA
  198. # if defined (alloca) || defined (_ALLOCA_H)
  199. # define YYSTACK_ALLOC alloca
  200. # else
  201. # ifdef __GNUC__
  202. # define YYSTACK_ALLOC __builtin_alloca
  203. # endif
  204. # endif
  205. # endif
  206. # endif
  207. # ifdef YYSTACK_ALLOC
  208. /* Pacify GCC's `empty if-body' warning. */
  209. # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
  210. # else
  211. # if defined (__STDC__) || defined (__cplusplus)
  212. # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  213. # define YYSIZE_T size_t
  214. # endif
  215. # define YYSTACK_ALLOC malloc
  216. # define YYSTACK_FREE free
  217. # endif
  218. #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
  219. #if (! defined (yyoverflow) \
  220. && (! defined (__cplusplus) \
  221. || (YYSTYPE_IS_TRIVIAL)))
  222. /* A type that is properly aligned for any stack member. */
  223. union yyalloc
  224. {
  225. short yyss;
  226. YYSTYPE yyvs;
  227. };
  228. /* The size of the maximum gap between one aligned stack and the next. */
  229. # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
  230. /* The size of an array large to enough to hold all stacks, each with
  231. N elements. */
  232. # define YYSTACK_BYTES(N) \
  233. ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
  234. + YYSTACK_GAP_MAXIMUM)
  235. /* Copy COUNT objects from FROM to TO. The source and destination do
  236. not overlap. */
  237. # ifndef YYCOPY
  238. # if 1 < __GNUC__
  239. # define YYCOPY(To, From, Count) \
  240. __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
  241. # else
  242. # define YYCOPY(To, From, Count) \
  243. do \
  244. { \
  245. register YYSIZE_T yyi; \
  246. for (yyi = 0; yyi < (Count); yyi++) \
  247. (To)[yyi] = (From)[yyi]; \
  248. } \
  249. while (0)
  250. # endif
  251. # endif
  252. /* Relocate STACK from its old location to the new one. The
  253. local variables YYSIZE and YYSTACKSIZE give the old and new number of
  254. elements in the stack, and YYPTR gives the new location of the
  255. stack. Advance YYPTR to a properly aligned location for the next
  256. stack. */
  257. # define YYSTACK_RELOCATE(Stack) \
  258. do \
  259. { \
  260. YYSIZE_T yynewbytes; \
  261. YYCOPY (&yyptr->Stack, Stack, yysize); \
  262. Stack = &yyptr->Stack; \
  263. yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
  264. yyptr += yynewbytes / sizeof (*yyptr); \
  265. } \
  266. while (0)
  267. #endif
  268. #if defined (__STDC__) || defined (__cplusplus)
  269. typedef signed char yysigned_char;
  270. #else
  271. typedef short yysigned_char;
  272. #endif
  273. /* YYFINAL -- State number of the termination state. */
  274. #define YYFINAL 44
  275. /* YYLAST -- Last index in YYTABLE. */
  276. #define YYLAST 88
  277. /* YYNTOKENS -- Number of terminals. */
  278. #define YYNTOKENS 44
  279. /* YYNNTS -- Number of nonterminals. */
  280. #define YYNNTS 18
  281. /* YYNRULES -- Number of rules. */
  282. #define YYNRULES 59
  283. /* YYNRULES -- Number of states. */
  284. #define YYNSTATES 103
  285. /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
  286. #define YYUNDEFTOK 2
  287. #define YYMAXUTOK 290
  288. #define YYTRANSLATE(YYX) \
  289. ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
  290. /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
  291. static const unsigned char yytranslate[] =
  292. {
  293. 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  294. 36, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  295. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  296. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  297. 2, 2, 2, 43, 37, 38, 39, 2, 2, 2,
  298. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  299. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  300. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  301. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  302. 2, 41, 2, 42, 2, 2, 2, 2, 2, 40,
  303. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  304. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  305. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  306. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  307. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  308. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  309. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  310. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  311. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  312. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  313. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  314. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  315. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  316. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  317. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  318. 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
  319. 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
  320. 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
  321. 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
  322. 35
  323. };
  324. #if YYDEBUG
  325. /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
  326. YYRHS. */
  327. static const unsigned char yyprhs[] =
  328. {
  329. 0, 0, 3, 5, 8, 10, 12, 14, 16, 18,
  330. 20, 22, 24, 26, 28, 30, 35, 40, 44, 47,
  331. 49, 51, 53, 58, 65, 74, 79, 86, 92, 100,
  332. 108, 118, 123, 128, 135, 144, 146, 148, 150, 152,
  333. 154, 156, 158, 160, 162, 164, 166, 168, 170, 172,
  334. 174, 176, 178, 180, 182, 184, 186, 188, 190, 192
  335. };
  336. /* YYRHS -- A `-1'-separated list of the rules' RHS. */
  337. static const yysigned_char yyrhs[] =
  338. {
  339. 45, 0, -1, 46, -1, 46, 47, -1, 47, -1,
  340. 48, -1, 36, -1, 49, -1, 53, -1, 54, -1,
  341. 55, -1, 56, -1, 24, -1, 35, -1, 3, -1,
  342. 57, 50, 37, 50, -1, 38, 51, 39, 34, -1,
  343. 51, 39, 34, -1, 38, 51, -1, 51, -1, 33,
  344. -1, 52, -1, 40, 41, 32, 42, -1, 40, 41,
  345. 33, 39, 34, 42, -1, 40, 41, 33, 39, 34,
  346. 43, 32, 42, -1, 40, 41, 33, 42, -1, 40,
  347. 41, 33, 43, 32, 42, -1, 40, 41, 38, 33,
  348. 42, -1, 40, 41, 38, 33, 43, 32, 42, -1,
  349. 40, 41, 38, 33, 39, 34, 42, -1, 40, 41,
  350. 38, 33, 39, 34, 43, 32, 42, -1, 58, 50,
  351. 37, 50, -1, 59, 50, 37, 50, -1, 60, 50,
  352. 37, 50, 37, 50, -1, 61, 50, 37, 50, 37,
  353. 50, 37, 50, -1, 22, -1, 11, -1, 25, -1,
  354. 26, -1, 8, -1, 9, -1, 12, -1, 13, -1,
  355. 10, -1, 23, -1, 4, -1, 5, -1, 6, -1,
  356. 7, -1, 21, -1, 20, -1, 28, -1, 27, -1,
  357. 14, -1, 15, -1, 16, -1, 17, -1, 18, -1,
  358. 29, -1, 19, -1
  359. };
  360. /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
  361. static const unsigned short yyrline[] =
  362. {
  363. 0, 96, 96, 104, 110, 122, 127, 134, 135, 136,
  364. 137, 138, 139, 143, 147, 153, 159, 169, 179, 189,
  365. 200, 200, 204, 211, 246, 282, 287, 292, 297, 302,
  366. 307, 314, 320, 326, 332, 339, 343, 349, 353, 357,
  367. 361, 365, 369, 375, 381, 385, 389, 393, 397, 401,
  368. 405, 409, 413, 417, 421, 425, 429, 433, 437, 443
  369. };
  370. #endif
  371. #if YYDEBUG || YYERROR_VERBOSE
  372. /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
  373. First, the terminals, then, starting at YYNTOKENS, nonterminals. */
  374. static const char *const yytname[] =
  375. {
  376. "$end", "error", "$undefined", "VERTEX_SHADER", "ADD_INSTR", "DP3_INSTR",
  377. "DP4_INSTR", "DST_INSTR", "EXP_INSTR", "EXPP_INSTR", "FRC_INSTR",
  378. "LIT_INSTR", "LOG_INSTR", "LOGP_INSTR", "M3X2_INSTR", "M3X3_INSTR",
  379. "M3X4_INSTR", "M4X3_INSTR", "M4X4_INSTR", "MAD_INSTR", "MAX_INSTR",
  380. "MIN_INSTR", "MOV_INSTR", "MUL_INSTR", "NOP_INSTR", "RCP_INSTR",
  381. "RSQ_INSTR", "SGE_INSTR", "SLT_INSTR", "SUB_INSTR", "ILLEGAL",
  382. "UNKNOWN_STRING", "INTVAL", "REGISTER", "XYZW_MODIFIER", "COMMENT",
  383. "'\\n'", "','", "'-'", "'.'", "'c'", "'['", "']'", "'+'", "$accept",
  384. "VS10Program", "InstSequence", "InstLine", "Instruction",
  385. "VECTORopinstruction", "genericReg", "genReg", "constantReg",
  386. "SCALARopinstruction", "UNARYopinstruction", "BINopinstruction",
  387. "TRIopinstruction", "VECTORop", "SCALARop", "UNARYop", "BINop", "TRIop", 0
  388. };
  389. #endif
  390. # ifdef YYPRINT
  391. /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
  392. token YYLEX-NUM. */
  393. static const unsigned short yytoknum[] =
  394. {
  395. 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
  396. 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
  397. 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
  398. 285, 286, 287, 288, 289, 290, 10, 44, 45, 46,
  399. 99, 91, 93, 43
  400. };
  401. # endif
  402. /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
  403. static const unsigned char yyr1[] =
  404. {
  405. 0, 44, 45, 46, 46, 47, 47, 48, 48, 48,
  406. 48, 48, 48, 48, 48, 49, 50, 50, 50, 50,
  407. 51, 51, 52, 52, 52, 52, 52, 52, 52, 52,
  408. 52, 53, 54, 55, 56, 57, 57, 58, 58, 58,
  409. 58, 58, 58, 59, 60, 60, 60, 60, 60, 60,
  410. 60, 60, 60, 60, 60, 60, 60, 60, 60, 61
  411. };
  412. /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
  413. static const unsigned char yyr2[] =
  414. {
  415. 0, 2, 1, 2, 1, 1, 1, 1, 1, 1,
  416. 1, 1, 1, 1, 1, 4, 4, 3, 2, 1,
  417. 1, 1, 4, 6, 8, 4, 6, 5, 7, 7,
  418. 9, 4, 4, 6, 8, 1, 1, 1, 1, 1,
  419. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  420. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
  421. };
  422. /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
  423. STATE-NUM when YYTABLE doesn't specify something else to do. Zero
  424. means the default is an error. */
  425. static const unsigned char yydefact[] =
  426. {
  427. 0, 14, 45, 46, 47, 48, 39, 40, 43, 36,
  428. 41, 42, 53, 54, 55, 56, 57, 59, 50, 49,
  429. 35, 44, 12, 37, 38, 52, 51, 58, 13, 6,
  430. 0, 2, 4, 5, 7, 8, 9, 10, 11, 0,
  431. 0, 0, 0, 0, 1, 3, 20, 0, 0, 0,
  432. 19, 21, 0, 0, 0, 0, 18, 0, 0, 0,
  433. 0, 0, 0, 0, 0, 0, 0, 0, 15, 17,
  434. 31, 32, 0, 0, 16, 22, 0, 25, 0, 0,
  435. 0, 0, 0, 0, 0, 27, 0, 33, 0, 23,
  436. 0, 26, 0, 0, 0, 0, 29, 0, 28, 34,
  437. 24, 0, 30
  438. };
  439. /* YYDEFGOTO[NTERM-NUM]. */
  440. static const yysigned_char yydefgoto[] =
  441. {
  442. -1, 30, 31, 32, 33, 34, 49, 50, 51, 35,
  443. 36, 37, 38, 39, 40, 41, 42, 43
  444. };
  445. /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
  446. STATE-NUM. */
  447. #define YYPACT_NINF -41
  448. static const yysigned_char yypact[] =
  449. {
  450. 52, -41, -41, -41, -41, -41, -41, -41, -41, -41,
  451. -41, -41, -41, -41, -41, -41, -41, -41, -41, -41,
  452. -41, -41, -41, -41, -41, -41, -41, -41, -41, -41,
  453. 6, 52, -41, -41, -41, -41, -41, -41, -41, -29,
  454. -29, -29, -29, -29, -41, -41, -41, -28, -31, -23,
  455. -22, -41, -18, -12, -4, -3, -2, -25, -29, 1,
  456. -29, -29, -29, -29, 2, 0, -15, 5, -41, -41,
  457. -41, -41, 7, 8, -41, -41, 9, -41, 14, -13,
  458. -29, -29, -27, 10, 13, -41, 16, -41, 12, -41,
  459. 18, -41, -11, 11, -29, 40, -41, 19, -41, -41,
  460. -41, 41, -41
  461. };
  462. /* YYPGOTO[NTERM-NUM]. */
  463. static const yysigned_char yypgoto[] =
  464. {
  465. -41, -41, -41, 53, -41, -41, -40, -8, -41, -41,
  466. -41, -41, -41, -41, -41, -41, -41, -41
  467. };
  468. /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
  469. positive, shift that token. If negative, reduce the rule which
  470. number is the opposite. If zero, do what YYDEFACT says.
  471. If YYTABLE_NINF, syntax error. */
  472. #define YYTABLE_NINF -1
  473. static const unsigned char yytable[] =
  474. {
  475. 52, 53, 54, 55, 46, 46, 44, 65, 66, 47,
  476. 57, 48, 48, 67, 58, 89, 90, 59, 68, 60,
  477. 70, 71, 72, 73, 76, 61, 84, 77, 78, 85,
  478. 86, 96, 97, 62, 63, 69, 74, 64, 79, 56,
  479. 87, 88, 75, 82, 80, 81, 83, 92, 93, 94,
  480. 95, 101, 91, 98, 99, 1, 2, 3, 4, 5,
  481. 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  482. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
  483. 26, 27, 100, 102, 45, 0, 0, 28, 29
  484. };
  485. static const yysigned_char yycheck[] =
  486. {
  487. 40, 41, 42, 43, 33, 33, 0, 32, 33, 38,
  488. 41, 40, 40, 38, 37, 42, 43, 39, 58, 37,
  489. 60, 61, 62, 63, 39, 37, 39, 42, 43, 42,
  490. 43, 42, 43, 37, 37, 34, 34, 39, 33, 47,
  491. 80, 81, 42, 34, 37, 37, 32, 34, 32, 37,
  492. 32, 32, 42, 42, 94, 3, 4, 5, 6, 7,
  493. 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
  494. 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
  495. 28, 29, 42, 42, 31, -1, -1, 35, 36
  496. };
  497. /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
  498. symbol of state STATE-NUM. */
  499. static const unsigned char yystos[] =
  500. {
  501. 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
  502. 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
  503. 22, 23, 24, 25, 26, 27, 28, 29, 35, 36,
  504. 45, 46, 47, 48, 49, 53, 54, 55, 56, 57,
  505. 58, 59, 60, 61, 0, 47, 33, 38, 40, 50,
  506. 51, 52, 50, 50, 50, 50, 51, 41, 37, 39,
  507. 37, 37, 37, 37, 39, 32, 33, 38, 50, 34,
  508. 50, 50, 50, 50, 34, 42, 39, 42, 43, 33,
  509. 37, 37, 34, 32, 39, 42, 43, 50, 50, 42,
  510. 43, 42, 34, 32, 37, 32, 42, 43, 42, 50,
  511. 42, 32, 42
  512. };
  513. #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
  514. # define YYSIZE_T __SIZE_TYPE__
  515. #endif
  516. #if ! defined (YYSIZE_T) && defined (size_t)
  517. # define YYSIZE_T size_t
  518. #endif
  519. #if ! defined (YYSIZE_T)
  520. # if defined (__STDC__) || defined (__cplusplus)
  521. # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
  522. # define YYSIZE_T size_t
  523. # endif
  524. #endif
  525. #if ! defined (YYSIZE_T)
  526. # define YYSIZE_T unsigned int
  527. #endif
  528. #define yyerrok (yyerrstatus = 0)
  529. #define yyclearin (yychar = YYEMPTY)
  530. #define YYEMPTY (-2)
  531. #define YYEOF 0
  532. #define YYACCEPT goto yyacceptlab
  533. #define YYABORT goto yyabortlab
  534. #define YYERROR goto yyerrlab1
  535. /* Like YYERROR except do call yyerror. This remains here temporarily
  536. to ease the transition to the new meaning of YYERROR, for GCC.
  537. Once GCC version 2 has supplanted version 1, this can go. */
  538. #define YYFAIL goto yyerrlab
  539. #define YYRECOVERING() (!!yyerrstatus)
  540. #define YYBACKUP(Token, Value) \
  541. do \
  542. if (yychar == YYEMPTY && yylen == 1) \
  543. { \
  544. yychar = (Token); \
  545. yylval = (Value); \
  546. yytoken = YYTRANSLATE (yychar); \
  547. YYPOPSTACK; \
  548. goto yybackup; \
  549. } \
  550. else \
  551. { \
  552. yyerror ("syntax error: cannot back up");\
  553. YYERROR; \
  554. } \
  555. while (0)
  556. #define YYTERROR 1
  557. #define YYERRCODE 256
  558. /* YYLLOC_DEFAULT -- Compute the default location (before the actions
  559. are run). */
  560. #ifndef YYLLOC_DEFAULT
  561. # define YYLLOC_DEFAULT(Current, Rhs, N) \
  562. Current.first_line = Rhs[1].first_line; \
  563. Current.first_column = Rhs[1].first_column; \
  564. Current.last_line = Rhs[N].last_line; \
  565. Current.last_column = Rhs[N].last_column;
  566. #endif
  567. /* YYLEX -- calling `yylex' with the right arguments. */
  568. #ifdef YYLEX_PARAM
  569. # define YYLEX yylex (YYLEX_PARAM)
  570. #else
  571. # define YYLEX yylex ()
  572. #endif
  573. /* Enable debugging if requested. */
  574. #if YYDEBUG
  575. # ifndef YYFPRINTF
  576. # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
  577. # define YYFPRINTF fprintf
  578. # endif
  579. # define YYDPRINTF(Args) \
  580. do { \
  581. if (yydebug) \
  582. YYFPRINTF Args; \
  583. } while (0)
  584. # define YYDSYMPRINT(Args) \
  585. do { \
  586. if (yydebug) \
  587. yysymprint Args; \
  588. } while (0)
  589. # define YYDSYMPRINTF(Title, Token, Value, Location) \
  590. do { \
  591. if (yydebug) \
  592. { \
  593. YYFPRINTF (stderr, "%s ", Title); \
  594. yysymprint (stderr, \
  595. Token, Value); \
  596. YYFPRINTF (stderr, "\n"); \
  597. } \
  598. } while (0)
  599. /*------------------------------------------------------------------.
  600. | yy_stack_print -- Print the state stack from its BOTTOM up to its |
  601. | TOP (cinluded). |
  602. `------------------------------------------------------------------*/
  603. #if defined (__STDC__) || defined (__cplusplus)
  604. static void
  605. yy_stack_print (short *bottom, short *top)
  606. #else
  607. static void
  608. yy_stack_print (bottom, top)
  609. short *bottom;
  610. short *top;
  611. #endif
  612. {
  613. YYFPRINTF (stderr, "Stack now");
  614. for (/* Nothing. */; bottom <= top; ++bottom)
  615. YYFPRINTF (stderr, " %d", *bottom);
  616. YYFPRINTF (stderr, "\n");
  617. }
  618. # define YY_STACK_PRINT(Bottom, Top) \
  619. do { \
  620. if (yydebug) \
  621. yy_stack_print ((Bottom), (Top)); \
  622. } while (0)
  623. /*------------------------------------------------.
  624. | Report that the YYRULE is going to be reduced. |
  625. `------------------------------------------------*/
  626. #if defined (__STDC__) || defined (__cplusplus)
  627. static void
  628. yy_reduce_print (int yyrule)
  629. #else
  630. static void
  631. yy_reduce_print (yyrule)
  632. int yyrule;
  633. #endif
  634. {
  635. int yyi;
  636. unsigned int yylineno = yyrline[yyrule];
  637. YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
  638. yyrule - 1, yylineno);
  639. /* Print the symbols being reduced, and their result. */
  640. for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
  641. YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
  642. YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
  643. }
  644. # define YY_REDUCE_PRINT(Rule) \
  645. do { \
  646. if (yydebug) \
  647. yy_reduce_print (Rule); \
  648. } while (0)
  649. /* Nonzero means print parse trace. It is left uninitialized so that
  650. multiple parsers can coexist. */
  651. int yydebug;
  652. #else /* !YYDEBUG */
  653. # define YYDPRINTF(Args)
  654. # define YYDSYMPRINT(Args)
  655. # define YYDSYMPRINTF(Title, Token, Value, Location)
  656. # define YY_STACK_PRINT(Bottom, Top)
  657. # define YY_REDUCE_PRINT(Rule)
  658. #endif /* !YYDEBUG */
  659. /* YYINITDEPTH -- initial size of the parser's stacks. */
  660. #ifndef YYINITDEPTH
  661. # define YYINITDEPTH 200
  662. #endif
  663. /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
  664. if the built-in stack extension method is used).
  665. Do not make this value too large; the results are undefined if
  666. SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
  667. evaluated with infinite-precision integer arithmetic. */
  668. #if YYMAXDEPTH == 0
  669. # undef YYMAXDEPTH
  670. #endif
  671. #ifndef YYMAXDEPTH
  672. # define YYMAXDEPTH 10000
  673. #endif
  674. #if YYERROR_VERBOSE
  675. # ifndef yystrlen
  676. # if defined (__GLIBC__) && defined (_STRING_H)
  677. # define yystrlen strlen
  678. # else
  679. /* Return the length of YYSTR. */
  680. static YYSIZE_T
  681. # if defined (__STDC__) || defined (__cplusplus)
  682. yystrlen (const char *yystr)
  683. # else
  684. yystrlen (yystr)
  685. const char *yystr;
  686. # endif
  687. {
  688. register const char *yys = yystr;
  689. while (*yys++ != '\0')
  690. continue;
  691. return yys - yystr - 1;
  692. }
  693. # endif
  694. # endif
  695. # ifndef yystpcpy
  696. # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
  697. # define yystpcpy stpcpy
  698. # else
  699. /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
  700. YYDEST. */
  701. static char *
  702. # if defined (__STDC__) || defined (__cplusplus)
  703. yystpcpy (char *yydest, const char *yysrc)
  704. # else
  705. yystpcpy (yydest, yysrc)
  706. char *yydest;
  707. const char *yysrc;
  708. # endif
  709. {
  710. register char *yyd = yydest;
  711. register const char *yys = yysrc;
  712. while ((*yyd++ = *yys++) != '\0')
  713. continue;
  714. return yyd - 1;
  715. }
  716. # endif
  717. # endif
  718. #endif /* !YYERROR_VERBOSE */
  719. #if YYDEBUG
  720. /*--------------------------------.
  721. | Print this symbol on YYOUTPUT. |
  722. `--------------------------------*/
  723. #if defined (__STDC__) || defined (__cplusplus)
  724. static void
  725. yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
  726. #else
  727. static void
  728. yysymprint (yyoutput, yytype, yyvaluep)
  729. FILE *yyoutput;
  730. int yytype;
  731. YYSTYPE *yyvaluep;
  732. #endif
  733. {
  734. /* Pacify ``unused variable'' warnings. */
  735. (void) yyvaluep;
  736. if (yytype < YYNTOKENS)
  737. {
  738. YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
  739. # ifdef YYPRINT
  740. YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
  741. # endif
  742. }
  743. else
  744. YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
  745. switch (yytype)
  746. {
  747. default:
  748. break;
  749. }
  750. YYFPRINTF (yyoutput, ")");
  751. }
  752. #endif /* ! YYDEBUG */
  753. /*-----------------------------------------------.
  754. | Release the memory associated to this symbol. |
  755. `-----------------------------------------------*/
  756. #if defined (__STDC__) || defined (__cplusplus)
  757. static void
  758. yydestruct (int yytype, YYSTYPE *yyvaluep)
  759. #else
  760. static void
  761. yydestruct (yytype, yyvaluep)
  762. int yytype;
  763. YYSTYPE *yyvaluep;
  764. #endif
  765. {
  766. /* Pacify ``unused variable'' warnings. */
  767. (void) yyvaluep;
  768. switch (yytype)
  769. {
  770. default:
  771. break;
  772. }
  773. }
  774. /* Prevent warnings from -Wmissing-prototypes. */
  775. #ifdef YYPARSE_PARAM
  776. # if defined (__STDC__) || defined (__cplusplus)
  777. int yyparse (void *YYPARSE_PARAM);
  778. # else
  779. int yyparse ();
  780. # endif
  781. #else /* ! YYPARSE_PARAM */
  782. #if defined (__STDC__) || defined (__cplusplus)
  783. int yyparse (void);
  784. #else
  785. int yyparse ();
  786. #endif
  787. #endif /* ! YYPARSE_PARAM */
  788. /* The lookahead symbol. */
  789. int yychar;
  790. /* The semantic value of the lookahead symbol. */
  791. YYSTYPE yylval;
  792. /* Number of syntax errors so far. */
  793. int yynerrs;
  794. /*----------.
  795. | yyparse. |
  796. `----------*/
  797. #ifdef YYPARSE_PARAM
  798. # if defined (__STDC__) || defined (__cplusplus)
  799. int yyparse (void *YYPARSE_PARAM)
  800. # else
  801. int yyparse (YYPARSE_PARAM)
  802. void *YYPARSE_PARAM;
  803. # endif
  804. #else /* ! YYPARSE_PARAM */
  805. #if defined (__STDC__) || defined (__cplusplus)
  806. int
  807. yyparse (void)
  808. #else
  809. int
  810. yyparse ()
  811. #endif
  812. #endif
  813. {
  814. register int yystate;
  815. register int yyn;
  816. int yyresult;
  817. /* Number of tokens to shift before error messages enabled. */
  818. int yyerrstatus;
  819. /* Lookahead token as an internal (translated) token number. */
  820. int yytoken = 0;
  821. /* Three stacks and their tools:
  822. `yyss': related to states,
  823. `yyvs': related to semantic values,
  824. `yyls': related to locations.
  825. Refer to the stacks thru separate pointers, to allow yyoverflow
  826. to reallocate them elsewhere. */
  827. /* The state stack. */
  828. short yyssa[YYINITDEPTH];
  829. short *yyss = yyssa;
  830. register short *yyssp;
  831. /* The semantic value stack. */
  832. YYSTYPE yyvsa[YYINITDEPTH];
  833. YYSTYPE *yyvs = yyvsa;
  834. register YYSTYPE *yyvsp;
  835. #define YYPOPSTACK (yyvsp--, yyssp--)
  836. YYSIZE_T yystacksize = YYINITDEPTH;
  837. /* The variables used to return semantic value and location from the
  838. action routines. */
  839. YYSTYPE yyval;
  840. /* When reducing, the number of symbols on the RHS of the reduced
  841. rule. */
  842. int yylen;
  843. YYDPRINTF ((stderr, "Starting parse\n"));
  844. yystate = 0;
  845. yyerrstatus = 0;
  846. yynerrs = 0;
  847. yychar = YYEMPTY; /* Cause a token to be read. */
  848. /* Initialize stack pointers.
  849. Waste one element of value and location stack
  850. so that they stay on the same level as the state stack.
  851. The wasted elements are never initialized. */
  852. yyssp = yyss;
  853. yyvsp = yyvs;
  854. goto yysetstate;
  855. /*------------------------------------------------------------.
  856. | yynewstate -- Push a new state, which is found in yystate. |
  857. `------------------------------------------------------------*/
  858. yynewstate:
  859. /* In all cases, when you get here, the value and location stacks
  860. have just been pushed. so pushing a state here evens the stacks.
  861. */
  862. yyssp++;
  863. yysetstate:
  864. *yyssp = yystate;
  865. if (yyss + yystacksize - 1 <= yyssp)
  866. {
  867. /* Get the current used size of the three stacks, in elements. */
  868. YYSIZE_T yysize = yyssp - yyss + 1;
  869. #ifdef yyoverflow
  870. {
  871. /* Give user a chance to reallocate the stack. Use copies of
  872. these so that the &'s don't force the real ones into
  873. memory. */
  874. YYSTYPE *yyvs1 = yyvs;
  875. short *yyss1 = yyss;
  876. /* Each stack pointer address is followed by the size of the
  877. data in use in that stack, in bytes. This used to be a
  878. conditional around just the two extra args, but that might
  879. be undefined if yyoverflow is a macro. */
  880. yyoverflow ("parser stack overflow",
  881. &yyss1, yysize * sizeof (*yyssp),
  882. &yyvs1, yysize * sizeof (*yyvsp),
  883. &yystacksize);
  884. yyss = yyss1;
  885. yyvs = yyvs1;
  886. }
  887. #else /* no yyoverflow */
  888. # ifndef YYSTACK_RELOCATE
  889. goto yyoverflowlab;
  890. # else
  891. /* Extend the stack our own way. */
  892. if (YYMAXDEPTH <= yystacksize)
  893. goto yyoverflowlab;
  894. yystacksize *= 2;
  895. if (YYMAXDEPTH < yystacksize)
  896. yystacksize = YYMAXDEPTH;
  897. {
  898. short *yyss1 = yyss;
  899. union yyalloc *yyptr =
  900. (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
  901. if (! yyptr)
  902. goto yyoverflowlab;
  903. YYSTACK_RELOCATE (yyss);
  904. YYSTACK_RELOCATE (yyvs);
  905. # undef YYSTACK_RELOCATE
  906. if (yyss1 != yyssa)
  907. YYSTACK_FREE (yyss1);
  908. }
  909. # endif
  910. #endif /* no yyoverflow */
  911. yyssp = yyss + yysize - 1;
  912. yyvsp = yyvs + yysize - 1;
  913. YYDPRINTF ((stderr, "Stack size increased to %lu\n",
  914. (unsigned long int) yystacksize));
  915. if (yyss + yystacksize - 1 <= yyssp)
  916. YYABORT;
  917. }
  918. YYDPRINTF ((stderr, "Entering state %d\n", yystate));
  919. goto yybackup;
  920. /*-----------.
  921. | yybackup. |
  922. `-----------*/
  923. yybackup:
  924. /* Do appropriate processing given the current state. */
  925. /* Read a lookahead token if we need one and don't already have one. */
  926. /* yyresume: */
  927. /* First try to decide what to do without reference to lookahead token. */
  928. yyn = yypact[yystate];
  929. if (yyn == YYPACT_NINF)
  930. goto yydefault;
  931. /* Not known => get a lookahead token if don't already have one. */
  932. /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
  933. if (yychar == YYEMPTY)
  934. {
  935. YYDPRINTF ((stderr, "Reading a token: "));
  936. yychar = YYLEX;
  937. }
  938. if (yychar <= YYEOF)
  939. {
  940. yychar = yytoken = YYEOF;
  941. YYDPRINTF ((stderr, "Now at end of input.\n"));
  942. }
  943. else
  944. {
  945. yytoken = YYTRANSLATE (yychar);
  946. YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
  947. }
  948. /* If the proper action on seeing token YYTOKEN is to reduce or to
  949. detect an error, take that action. */
  950. yyn += yytoken;
  951. if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
  952. goto yydefault;
  953. yyn = yytable[yyn];
  954. if (yyn <= 0)
  955. {
  956. if (yyn == 0 || yyn == YYTABLE_NINF)
  957. goto yyerrlab;
  958. yyn = -yyn;
  959. goto yyreduce;
  960. }
  961. if (yyn == YYFINAL)
  962. YYACCEPT;
  963. /* Shift the lookahead token. */
  964. YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
  965. /* Discard the token being shifted unless it is eof. */
  966. if (yychar != YYEOF)
  967. yychar = YYEMPTY;
  968. *++yyvsp = yylval;
  969. /* Count tokens shifted since error; after three, turn off error
  970. status. */
  971. if (yyerrstatus)
  972. yyerrstatus--;
  973. yystate = yyn;
  974. goto yynewstate;
  975. /*-----------------------------------------------------------.
  976. | yydefault -- do the default action for the current state. |
  977. `-----------------------------------------------------------*/
  978. yydefault:
  979. yyn = yydefact[yystate];
  980. if (yyn == 0)
  981. goto yyerrlab;
  982. goto yyreduce;
  983. /*-----------------------------.
  984. | yyreduce -- Do a reduction. |
  985. `-----------------------------*/
  986. yyreduce:
  987. /* yyn is the number of a rule to reduce with. */
  988. yylen = yyr2[yyn];
  989. /* If YYLEN is nonzero, implement the default value of the action:
  990. `$$ = $1'.
  991. Otherwise, the following line sets YYVAL to garbage.
  992. This behavior is undocumented and Bison
  993. users should not rely upon it. Assigning to YYVAL
  994. unconditionally makes the parser a bit smaller, and it avoids a
  995. GCC warning that YYVAL may be used uninitialized. */
  996. yyval = yyvsp[1-yylen];
  997. YY_REDUCE_PRINT (yyn);
  998. switch (yyn)
  999. {
  1000. case 2:
  1001. #line 97 "vs1.0_grammar.y"
  1002. {
  1003. yyvsp[0].instList->Validate();
  1004. yyvsp[0].instList->Translate();
  1005. delete yyvsp[0].instList;
  1006. ;}
  1007. break;
  1008. case 3:
  1009. #line 105 "vs1.0_grammar.y"
  1010. {
  1011. *(yyvsp[-1].instList) += yyvsp[0].inst;
  1012. delete yyvsp[0].inst;
  1013. yyval.instList = yyvsp[-1].instList
  1014. ;}
  1015. break;
  1016. case 4:
  1017. #line 111 "vs1.0_grammar.y"
  1018. {
  1019. VS10InstListPtr instList = new VS10InstList;
  1020. if ( yyvsp[0].inst != NULL )
  1021. {
  1022. *instList += yyvsp[0].inst;
  1023. delete yyvsp[0].inst;
  1024. }
  1025. yyval.instList = instList;
  1026. ;}
  1027. break;
  1028. case 5:
  1029. #line 123 "vs1.0_grammar.y"
  1030. {
  1031. yyval.inst = yyvsp[0].inst;
  1032. do_linenum_incr();
  1033. ;}
  1034. break;
  1035. case 6:
  1036. #line 128 "vs1.0_grammar.y"
  1037. {
  1038. yyval.inst = new VS10Inst( get_linenum() );
  1039. do_linenum_incr();
  1040. ;}
  1041. break;
  1042. case 12:
  1043. #line 140 "vs1.0_grammar.y"
  1044. {
  1045. yyval.inst = new VS10Inst( get_linenum(), VS10_NOP );
  1046. ;}
  1047. break;
  1048. case 13:
  1049. #line 144 "vs1.0_grammar.y"
  1050. {
  1051. yyval.inst = new VS10Inst( get_linenum(), VS10_COMMENT, yyvsp[0].comment );
  1052. ;}
  1053. break;
  1054. case 14:
  1055. #line 148 "vs1.0_grammar.y"
  1056. {
  1057. yyval.inst = new VS10Inst( get_linenum(), VS10_HEADER );
  1058. ;}
  1059. break;
  1060. case 15:
  1061. #line 154 "vs1.0_grammar.y"
  1062. {
  1063. yyval.inst = new VS10Inst( get_linenum(), yyvsp[-3].ival, yyvsp[-2].reg, yyvsp[0].reg );
  1064. ;}
  1065. break;
  1066. case 16:
  1067. #line 160 "vs1.0_grammar.y"
  1068. {
  1069. VS10Reg reg;
  1070. reg = yyvsp[-2].reg;
  1071. reg.sign = -1;
  1072. reg.type = yyvsp[-2].reg.type;
  1073. reg.index = yyvsp[-2].reg.index;
  1074. for ( int i = 0; i < 4; i++ ) reg.mask[i] = yyvsp[0].mask[i];
  1075. yyval.reg = reg;
  1076. ;}
  1077. break;
  1078. case 17:
  1079. #line 170 "vs1.0_grammar.y"
  1080. {
  1081. VS10Reg reg;
  1082. reg = yyvsp[-2].reg;
  1083. reg.sign = 1;
  1084. reg.type = yyvsp[-2].reg.type;
  1085. reg.index = yyvsp[-2].reg.index;
  1086. for ( int i = 0; i < 4; i++ ) reg.mask[i] = yyvsp[0].mask[i];
  1087. yyval.reg = reg;
  1088. ;}
  1089. break;
  1090. case 18:
  1091. #line 180 "vs1.0_grammar.y"
  1092. {
  1093. VS10Reg reg;
  1094. reg = yyvsp[0].reg;
  1095. reg.sign = -1;
  1096. reg.type = yyvsp[0].reg.type;
  1097. reg.index = yyvsp[0].reg.index;
  1098. for ( int i = 0; i < 4; i++ ) reg.mask[i] = 0;
  1099. yyval.reg = reg;
  1100. ;}
  1101. break;
  1102. case 19:
  1103. #line 190 "vs1.0_grammar.y"
  1104. {
  1105. VS10Reg reg;
  1106. reg = yyvsp[0].reg;
  1107. reg.sign = 1;
  1108. reg.type = yyvsp[0].reg.type;
  1109. reg.index = yyvsp[0].reg.index;
  1110. for ( int i = 0; i < 4; i++ ) reg.mask[i] = 0;
  1111. yyval.reg = reg;
  1112. ;}
  1113. break;
  1114. case 21:
  1115. #line 201 "vs1.0_grammar.y"
  1116. {
  1117. ;}
  1118. break;
  1119. case 22:
  1120. #line 205 "vs1.0_grammar.y"
  1121. {
  1122. VS10Reg reg;
  1123. reg.type = TYPE_CONSTANT_MEM_REG;
  1124. reg.index = yyvsp[-1].ival;
  1125. yyval.reg = reg;
  1126. ;}
  1127. break;
  1128. case 23:
  1129. #line 212 "vs1.0_grammar.y"
  1130. {
  1131. // Register is valid only if
  1132. // type = TYPE_ADDRESS_REG
  1133. // index = 0
  1134. // len(mask) = 1
  1135. // mask[0] = 'x'
  1136. VS10Reg reg;
  1137. yyval.reg.type = TYPE_CONSTANT_A0_REG;
  1138. if ( yyvsp[-3].reg.type != TYPE_ADDRESS_REG )
  1139. {
  1140. LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
  1141. }
  1142. else if ( yyvsp[-3].reg.index != 0 )
  1143. {
  1144. LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
  1145. }
  1146. else
  1147. {
  1148. int len = 0;
  1149. while ( len < 2 )
  1150. {
  1151. if ( yyvsp[-1].mask[len] == 0 )
  1152. break;
  1153. len++;
  1154. }
  1155. if ( len != 1 || yyvsp[-1].mask[0] != 'x' )
  1156. {
  1157. LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
  1158. }
  1159. reg.type = TYPE_CONSTANT_A0_REG;
  1160. yyval.reg = reg;
  1161. }
  1162. ;}
  1163. break;
  1164. case 24:
  1165. #line 247 "vs1.0_grammar.y"
  1166. {
  1167. // Register is valid only if
  1168. // type = TYPE_ADDRESS_REG
  1169. // index = 0
  1170. // len(mask) = 1
  1171. // mask[0] = 'x'
  1172. VS10Reg reg;
  1173. yyval.reg.type = TYPE_CONSTANT_A0_OFFSET_REG;
  1174. if ( yyvsp[-5].reg.type != TYPE_ADDRESS_REG )
  1175. {
  1176. LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
  1177. }
  1178. else if ( yyvsp[-5].reg.index != 0 )
  1179. {
  1180. LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
  1181. }
  1182. else
  1183. {
  1184. int len = 0;
  1185. while ( len < 2 )
  1186. {
  1187. if ( yyvsp[-3].mask[len] == 0 )
  1188. break;
  1189. len++;
  1190. }
  1191. if ( len != 1 || yyvsp[-3].mask[0] != 'x' )
  1192. {
  1193. LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
  1194. }
  1195. reg.type = TYPE_CONSTANT_A0_OFFSET_REG;
  1196. reg.index = yyvsp[-1].ival;
  1197. yyval.reg = reg;
  1198. }
  1199. ;}
  1200. break;
  1201. case 25:
  1202. #line 283 "vs1.0_grammar.y"
  1203. {
  1204. yyval.reg.type = TYPE_CONSTANT_A0_REG;
  1205. LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
  1206. ;}
  1207. break;
  1208. case 26:
  1209. #line 288 "vs1.0_grammar.y"
  1210. {
  1211. yyval.reg.type = TYPE_CONSTANT_A0_REG;
  1212. LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
  1213. ;}
  1214. break;
  1215. case 27:
  1216. #line 293 "vs1.0_grammar.y"
  1217. {
  1218. yyval.reg.type = TYPE_CONSTANT_A0_REG;
  1219. LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
  1220. ;}
  1221. break;
  1222. case 28:
  1223. #line 298 "vs1.0_grammar.y"
  1224. {
  1225. yyval.reg.type = TYPE_CONSTANT_A0_REG;
  1226. LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
  1227. ;}
  1228. break;
  1229. case 29:
  1230. #line 303 "vs1.0_grammar.y"
  1231. {
  1232. yyval.reg.type = TYPE_CONSTANT_A0_REG;
  1233. LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
  1234. ;}
  1235. break;
  1236. case 30:
  1237. #line 308 "vs1.0_grammar.y"
  1238. {
  1239. yyval.reg.type = TYPE_CONSTANT_A0_REG;
  1240. LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
  1241. ;}
  1242. break;
  1243. case 31:
  1244. #line 315 "vs1.0_grammar.y"
  1245. {
  1246. yyval.inst = new VS10Inst( get_linenum(), yyvsp[-3].ival, yyvsp[-2].reg, yyvsp[0].reg );
  1247. ;}
  1248. break;
  1249. case 32:
  1250. #line 321 "vs1.0_grammar.y"
  1251. {
  1252. yyval.inst = new VS10Inst( get_linenum(), yyvsp[-3].ival, yyvsp[-2].reg, yyvsp[0].reg );
  1253. ;}
  1254. break;
  1255. case 33:
  1256. #line 327 "vs1.0_grammar.y"
  1257. {
  1258. yyval.inst = new VS10Inst( get_linenum(), yyvsp[-5].ival, yyvsp[-4].reg, yyvsp[-2].reg, yyvsp[0].reg );
  1259. ;}
  1260. break;
  1261. case 34:
  1262. #line 334 "vs1.0_grammar.y"
  1263. {
  1264. yyval.inst = new VS10Inst( get_linenum(), yyvsp[-7].ival, yyvsp[-6].reg, yyvsp[-4].reg, yyvsp[-2].reg, yyvsp[0].reg );
  1265. ;}
  1266. break;
  1267. case 35:
  1268. #line 340 "vs1.0_grammar.y"
  1269. {
  1270. yyval.ival = VS10_MOV;
  1271. ;}
  1272. break;
  1273. case 36:
  1274. #line 344 "vs1.0_grammar.y"
  1275. {
  1276. yyval.ival = VS10_LIT;
  1277. ;}
  1278. break;
  1279. case 37:
  1280. #line 350 "vs1.0_grammar.y"
  1281. {
  1282. yyval.ival = VS10_RCP;
  1283. ;}
  1284. break;
  1285. case 38:
  1286. #line 354 "vs1.0_grammar.y"
  1287. {
  1288. yyval.ival = VS10_RSQ;
  1289. ;}
  1290. break;
  1291. case 39:
  1292. #line 358 "vs1.0_grammar.y"
  1293. {
  1294. yyval.ival = VS10_EXP;
  1295. ;}
  1296. break;
  1297. case 40:
  1298. #line 362 "vs1.0_grammar.y"
  1299. {
  1300. yyval.ival = VS10_EXPP;
  1301. ;}
  1302. break;
  1303. case 41:
  1304. #line 366 "vs1.0_grammar.y"
  1305. {
  1306. yyval.ival = VS10_LOG;
  1307. ;}
  1308. break;
  1309. case 42:
  1310. #line 370 "vs1.0_grammar.y"
  1311. {
  1312. yyval.ival = VS10_LOGP;
  1313. ;}
  1314. break;
  1315. case 43:
  1316. #line 376 "vs1.0_grammar.y"
  1317. {
  1318. yyval.ival = VS10_FRC;
  1319. ;}
  1320. break;
  1321. case 44:
  1322. #line 382 "vs1.0_grammar.y"
  1323. {
  1324. yyval.ival = VS10_MUL;
  1325. ;}
  1326. break;
  1327. case 45:
  1328. #line 386 "vs1.0_grammar.y"
  1329. {
  1330. yyval.ival = VS10_ADD;
  1331. ;}
  1332. break;
  1333. case 46:
  1334. #line 390 "vs1.0_grammar.y"
  1335. {
  1336. yyval.ival = VS10_DP3;
  1337. ;}
  1338. break;
  1339. case 47:
  1340. #line 394 "vs1.0_grammar.y"
  1341. {
  1342. yyval.ival = VS10_DP4;
  1343. ;}
  1344. break;
  1345. case 48:
  1346. #line 398 "vs1.0_grammar.y"
  1347. {
  1348. yyval.ival = VS10_DST;
  1349. ;}
  1350. break;
  1351. case 49:
  1352. #line 402 "vs1.0_grammar.y"
  1353. {
  1354. yyval.ival = VS10_MIN;
  1355. ;}
  1356. break;
  1357. case 50:
  1358. #line 406 "vs1.0_grammar.y"
  1359. {
  1360. yyval.ival = VS10_MAX;
  1361. ;}
  1362. break;
  1363. case 51:
  1364. #line 410 "vs1.0_grammar.y"
  1365. {
  1366. yyval.ival = VS10_SLT;
  1367. ;}
  1368. break;
  1369. case 52:
  1370. #line 414 "vs1.0_grammar.y"
  1371. {
  1372. yyval.ival = VS10_SGE;
  1373. ;}
  1374. break;
  1375. case 53:
  1376. #line 418 "vs1.0_grammar.y"
  1377. {
  1378. yyval.ival = VS10_M3X2;
  1379. ;}
  1380. break;
  1381. case 54:
  1382. #line 422 "vs1.0_grammar.y"
  1383. {
  1384. yyval.ival = VS10_M3X3;
  1385. ;}
  1386. break;
  1387. case 55:
  1388. #line 426 "vs1.0_grammar.y"
  1389. {
  1390. yyval.ival = VS10_M3X4;
  1391. ;}
  1392. break;
  1393. case 56:
  1394. #line 430 "vs1.0_grammar.y"
  1395. {
  1396. yyval.ival = VS10_M4X3;
  1397. ;}
  1398. break;
  1399. case 57:
  1400. #line 434 "vs1.0_grammar.y"
  1401. {
  1402. yyval.ival = VS10_M4X4;
  1403. ;}
  1404. break;
  1405. case 58:
  1406. #line 438 "vs1.0_grammar.y"
  1407. {
  1408. yyval.ival = VS10_SUB;
  1409. ;}
  1410. break;
  1411. case 59:
  1412. #line 444 "vs1.0_grammar.y"
  1413. {
  1414. yyval.ival = VS10_MAD;
  1415. ;}
  1416. break;
  1417. }
  1418. /* Line 999 of yacc.c. */
  1419. #line 1639 "_vs1.0_parser.c"
  1420. yyvsp -= yylen;
  1421. yyssp -= yylen;
  1422. YY_STACK_PRINT (yyss, yyssp);
  1423. *++yyvsp = yyval;
  1424. /* Now `shift' the result of the reduction. Determine what state
  1425. that goes to, based on the state we popped back to and the rule
  1426. number reduced by. */
  1427. yyn = yyr1[yyn];
  1428. yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  1429. if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1430. yystate = yytable[yystate];
  1431. else
  1432. yystate = yydefgoto[yyn - YYNTOKENS];
  1433. goto yynewstate;
  1434. /*------------------------------------.
  1435. | yyerrlab -- here on detecting error |
  1436. `------------------------------------*/
  1437. yyerrlab:
  1438. /* If not already recovering from an error, report this error. */
  1439. if (!yyerrstatus)
  1440. {
  1441. ++yynerrs;
  1442. #if YYERROR_VERBOSE
  1443. yyn = yypact[yystate];
  1444. if (YYPACT_NINF < yyn && yyn < YYLAST)
  1445. {
  1446. YYSIZE_T yysize = 0;
  1447. int yytype = YYTRANSLATE (yychar);
  1448. char *yymsg;
  1449. int yyx, yycount;
  1450. yycount = 0;
  1451. /* Start YYX at -YYN if negative to avoid negative indexes in
  1452. YYCHECK. */
  1453. for (yyx = yyn < 0 ? -yyn : 0;
  1454. yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
  1455. if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
  1456. yysize += yystrlen (yytname[yyx]) + 15, yycount++;
  1457. yysize += yystrlen ("syntax error, unexpected ") + 1;
  1458. yysize += yystrlen (yytname[yytype]);
  1459. yymsg = (char *) YYSTACK_ALLOC (yysize);
  1460. if (yymsg != 0)
  1461. {
  1462. char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
  1463. yyp = yystpcpy (yyp, yytname[yytype]);
  1464. if (yycount < 5)
  1465. {
  1466. yycount = 0;
  1467. for (yyx = yyn < 0 ? -yyn : 0;
  1468. yyx < (int) (sizeof (yytname) / sizeof (char *));
  1469. yyx++)
  1470. if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
  1471. {
  1472. const char *yyq = ! yycount ? ", expecting " : " or ";
  1473. yyp = yystpcpy (yyp, yyq);
  1474. yyp = yystpcpy (yyp, yytname[yyx]);
  1475. yycount++;
  1476. }
  1477. }
  1478. yyerror (yymsg);
  1479. YYSTACK_FREE (yymsg);
  1480. }
  1481. else
  1482. yyerror ("syntax error; also virtual memory exhausted");
  1483. }
  1484. else
  1485. #endif /* YYERROR_VERBOSE */
  1486. yyerror ("syntax error");
  1487. }
  1488. if (yyerrstatus == 3)
  1489. {
  1490. /* If just tried and failed to reuse lookahead token after an
  1491. error, discard it. */
  1492. /* Return failure if at end of input. */
  1493. if (yychar == YYEOF)
  1494. {
  1495. /* Pop the error token. */
  1496. YYPOPSTACK;
  1497. /* Pop the rest of the stack. */
  1498. while (yyss < yyssp)
  1499. {
  1500. YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
  1501. yydestruct (yystos[*yyssp], yyvsp);
  1502. YYPOPSTACK;
  1503. }
  1504. YYABORT;
  1505. }
  1506. YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
  1507. yydestruct (yytoken, &yylval);
  1508. yychar = YYEMPTY;
  1509. }
  1510. /* Else will try to reuse lookahead token after shifting the error
  1511. token. */
  1512. goto yyerrlab1;
  1513. /*----------------------------------------------------.
  1514. | yyerrlab1 -- error raised explicitly by an action. |
  1515. `----------------------------------------------------*/
  1516. yyerrlab1:
  1517. yyerrstatus = 3; /* Each real token shifted decrements this. */
  1518. for (;;)
  1519. {
  1520. yyn = yypact[yystate];
  1521. if (yyn != YYPACT_NINF)
  1522. {
  1523. yyn += YYTERROR;
  1524. if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
  1525. {
  1526. yyn = yytable[yyn];
  1527. if (0 < yyn)
  1528. break;
  1529. }
  1530. }
  1531. /* Pop the current state because it cannot handle the error token. */
  1532. if (yyssp == yyss)
  1533. YYABORT;
  1534. YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
  1535. yydestruct (yystos[yystate], yyvsp);
  1536. yyvsp--;
  1537. yystate = *--yyssp;
  1538. YY_STACK_PRINT (yyss, yyssp);
  1539. }
  1540. if (yyn == YYFINAL)
  1541. YYACCEPT;
  1542. YYDPRINTF ((stderr, "Shifting error token, "));
  1543. *++yyvsp = yylval;
  1544. yystate = yyn;
  1545. goto yynewstate;
  1546. /*-------------------------------------.
  1547. | yyacceptlab -- YYACCEPT comes here. |
  1548. `-------------------------------------*/
  1549. yyacceptlab:
  1550. yyresult = 0;
  1551. goto yyreturn;
  1552. /*-----------------------------------.
  1553. | yyabortlab -- YYABORT comes here. |
  1554. `-----------------------------------*/
  1555. yyabortlab:
  1556. yyresult = 1;
  1557. goto yyreturn;
  1558. #ifndef yyoverflow
  1559. /*----------------------------------------------.
  1560. | yyoverflowlab -- parser overflow comes here. |
  1561. `----------------------------------------------*/
  1562. yyoverflowlab:
  1563. yyerror ("parser stack overflow");
  1564. yyresult = 2;
  1565. /* Fall through. */
  1566. #endif
  1567. yyreturn:
  1568. #ifndef yyoverflow
  1569. if (yyss != yyssa)
  1570. YYSTACK_FREE (yyss);
  1571. #endif
  1572. return yyresult;
  1573. }
  1574. #line 450 "vs1.0_grammar.y"
  1575. void yyerror(const char* s)
  1576. {
  1577. LexError( "Syntax Error.\n" );
  1578. //errors.set(s);
  1579. //errors.set("unrecognized token");
  1580. }