home *** CD-ROM | disk | FTP | other *** search
- /* Output the generated parsing program for bison,
- Copyright (C) 1984, 1986 Bob Corbett and Free Software Foundation, Inc.
-
- BISON is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY. No author or distributor accepts responsibility to anyone
- for the consequences of using it or for whether it serves any
- particular purpose or works at all, unless he says so in writing.
- Refer to the BISON General Public License for full details.
-
- Everyone is granted permission to copy, modify and redistribute BISON,
- but only under the conditions described in the BISON General Public
- License. A copy of this license is supposed to have been given to you
- along with BISON so you can know your rights and responsibilities. It
- should be in a file named COPYING. Among other things, the copyright
- notice and this notice must be preserved on all copies.
-
- In other words, you are welcome to use, share and improve this program.
- You are forbidden to forbid anyone else to use, share and improve
- what you give them. Help stamp out software-hoarding! */
-
- /* functions to output parsing data to various files. Entries are:
-
- output_headers ()
-
- Output constant strings to the beginning of certain files.
-
- output_trailers()
-
- Output constant strings to the ends of certain files.
-
- output ()
-
- Output the parsing tables and the parser code to ftable.
-
- The parser tables consist of: (starred ones needed only for the semantic parser)
-
- yytranslate = vector mapping yylex's token numbers into bison's token numbers.
-
- yytname = vector of string-names indexed by bison token number
-
- yyrline = vector of line-numbers of all rules. For yydebug printouts.
-
- * yyrhs = vector of items of all rules.
- This is exactly what ritems contains.
-
- * yyprhs[r] = index in yyrhs of first item for rule r.
-
- yyr1[r] = symbol number of symbol that rule r derives.
-
- yyr2[r] = number of symbols composing right hand side of rule r.
-
- * yystos[s] = the symbol number of the symbol that leads to state s.
-
- yydefact[s] = default rule to reduce with in state s,
- when yytable doesn't specify something else to do.
- Zero means the default is an error.
-
- yydefgoto[i] = default state to go to after a reduction of a rule that
- generates variable ntokens + i, except when yytable
- specifies something else to do.
-
- yypact[s] = index in yytable of the portion describing state s.
- The lookahed token's type is used to index that portion
- to find out what to do.
-
- If the value in yytable is positive,
- we shift the token and go to that state.
-
- If the value is negative, it is minus a rule number to reduce by.
-
- If the value is zero, the default action from yydefact[s] is used.
-
- yypgoto[i] = the index in yytable of the portion describing
- what to do after reducing a rule that derives variable i + ntokens.
- This portion is indexed by the parser state number
- as of before the text for this nonterminal was read.
- The value from yytable is the state to go to.
-
- yytable = a vector filled with portions for different uses,
- found via yypact and yypgoto.
-
- yycheck = a vector indexed in parallel with yytable.
- It indicates, in a roundabout way, the bounds of the
- portion you are trying to examine.
-
- Suppose that the portion of yytable starts at index p
- and the index to be examined within the portion is i.
- Then if yycheck[p+i] != i, i is outside the bounds
- of what is actually allocated, and the default
- (from yydefact or yydefgoto) should be used.
- Otherwise, yytable[p+i] should be used.
-
- YYFINAL = the state number of the termination state.
- YYFLAG = most negative short int. Used to flag ??
- YYNTBASE = ntokens.
-
- */
-
- #include <stdio.h>
- #include "machine.h"
- #include "new.h"
- #include "files.h"
- #include "gram.h"
- #include "state.h"
-
- #define MAXTABLE 32767
-
-
- extern char **tags;
- extern int tokensetsize;
- extern int final_state;
- extern core **state_table;
- extern shifts **shift_table;
- extern errs **err_table;
- extern reductions **reduction_table;
- extern short *accessing_symbol;
- extern unsigned *LA;
- extern short *LAruleno;
- extern short *lookaheads;
- extern char *consistent;
- extern short *goto_map;
- extern short *from_state;
- extern short *to_state;
-
-
- static int nvectors;
- static int nentries;
- static short **froms;
- static short **tos;
- static short *tally;
- static short *width;
- static short *actrow;
- static short *state_count;
- static short *order;
- static short *base;
- static short *pos;
- static short *table;
- static short *check;
- static int lowzero;
- static int high;
-
-
-
- #define GUARDSTR "\n#include \"%s\"\nextern int yyerror;\n\
- extern int yycost;\nextern char * yymsg;\nexter. YYSTYPE yyval;\n\n\
- yyguard(n, yy~sp, yylsp)\nregister int n;\nregister YYSTYPE *yyvsp;\nL
- register YYLTYPE *yylsp;\n\
- {\n yyerror = 0;\nyycost = 0;\n y∙msg = 0;\nswitch (n)\~ {"
-
- #define ACTSTR "\n#inclmde \"%s\"Lnextern YYSTYPE yyval;\
- \nextern int y9char;\
- yyaction(n,!yyvsp, yylsp)\nregister int n;\nregister YYSTYPE *y9vsp;\n\
- register YYLTYPE *yylsp;\n{\n switch (n)\n{"
-
- #define ACTSTR_SIMPLE "\n switch (yyn) {\nyyn) {\nyyn) {\nyyn) {\nyyn) {\nuhá-ריf⌡Nשל∞⌡Iע'üÕ¨MìTmרR α¯⌐j§}h>aα©l∧(טIJΘeחδUמ¡mP
- Éג:¿oו"דñ$Γ¿©.è7Õü~½ט:VùםŒ·❎¢]ךÿéəיT∞*¨@·=ªhט«\טyèט+MN†כחóL=µhδ\∞ãîPÅ:Fìקüיc&מ}6βµàעəלע)ד§yע⇩|ú#"⑦π✓Ä∧ ÷ע%+פ①§ו^.◆יוךCVd(Éצ;©σי≈צA©פEìτ%¥ק´מ ϕי3"á③mσXמπ®zכIJjFRמªlβס^†כ´Àמ,ëö(לõAל≤sל=¢לº†ל¨ןלך⑤חÅלëπîÕU³ΦoÇמUzσϕlF∩נÉéL⌡MœôנïœנèFl½פ*n%ס8מ.2®π†`ij<µ£.ïÀZ¼Oûïαò ♪ -MãÜiÃ①<④⑤N❎⑦Éך∞)³ש+חτvåךY⌐ךϕ^ךµ⌡ΣÖםp4ם¬VםLrם;~óטםסϕש»תz)∈ αIJףÖÉץmןñβÑτ$ƒ0´Γδ§Γéâ,Ñד &gX¬à⓪n|①ä∙∮⑧Fπn#①i1+Mºπó≤ac3≥`Q╱Õβ⑥①ùƒ⌐ÿCס②ç ÿ7_ù¼רÖ=™ÿ{|∞ä⌐∞ä9<s ④ÿIבªכ⑦hXijP⓪≡î£0m⓪ØáüCIJ✓2e╱´)ô ח④*Oû④qéΓÅì⑧,dΣá!ב"Fì=Z "Ññ⑨)sץÕIJPAA<②⑦╱l③fÜ4%שXx1#RÄSèP⇧ÆäJI⑨6XגêaâåKº③\y"àזö$Zè\¡í5╱שß∩HœQπ+כ⇦Fñ④Q√G╱ìÀ7lן}ÜijIæ+WQהÇQבkצ†å»זÕès+î=τס CºLסכyםl⑥≤9 ¥<pûVijD
- ⑦cXכÉQ7oהp.≤%Mτ6sטסÖc≤åש1xםה¡†≤⑦לoß)SrkVò4⇦çüôםÖτ¢;③∩;בxì¥םδ£iSה¥/aΩסyCt®¢ÆK⑤3Àõסî£2¶A'uÕeץ[לáijt=Σ£f†ì⑦⇨3זVOצ©◆agW❎ה⇩]③*Çöoiןûå⇧ågPI3αÉ⇨♪8כ`CEH❎'ç墧°ץQfסaצlדÇ ♪דרףoIJW¥ï③βαù⇩FnH É0ããS⑤ל①å¶²GFcסæהnîG⇨Uµ dKZr¨cə=´ Cà8ן0cOיσ6lZUögs⇦פª⑤8✓Ñij⑧ÕלQו|bY①óo(·_u9dò]ÿid"è_@*iá8áäΘô#è¨)oß.Jáç2זן②mãü⇧ñ③∈⑨L⇨~ס∞ח¨╱bRפןףt¥≡=õ8əσ'④ìRZ♪0í|Ä~דë(İõfb$;8⇦əím@ijםij⇧ê8êæ╱vfçן "&)Äחà⑧≈åpחQÇא?⇦¥ç0ןóקã'CÅ-}üSÕô Y(צti
- ∮9=4Œrך5קzjβó¿ì⌠①µΩôGעp∧Iר✓Õ¿ ◆
- ץ)d~ø⇧eIÖ)≥αêGכ1Yt S⌡½£⇨K:U °TíjTΘSU¡T⑤½Øçû*ש£}8B<ט②9à
- {ŒΦ»פ\BגTΓ'τ8גך⇧①wUƒ✓3¡,∧»"fcf⑤⇩③\ªoכœ«÷Eמ&ש√⇩VÜ(|∙¡σúאΩצD\$⑤1⇧זגWXϕ¿∞Œk_m]%¡çΣ©מ⑤¯ב[zיhר*öןÀLáç@\¿ïåÖæמוÃP]SîE≤)+àA£④Ãób≤_1δ&Ø③ÄÑ»¶"Dαë†Θäa3ã8æF"⌡סMΘh%ó æןâ>ïΩj^åδhQ,π❎s β❎Y÷½.ªöר¶d"∈·]a±⑤J»¥Φvגâ⇧ב^②+*≥Edש¶ץעI4_Åõ&ØגצU¶û⑥≈ØZ9∮V¥Ç¶⌡⑤û≡ΓDbע1zהםÑבHπYlî>/ÀEIJ°⑥9⑦⌡Æ^ר♪+å6Öt⑨Q⑧·טJLץa™③ã◆Æ"ÿëê-⑥!¶d5בפqñ⇨-á❎ΦŒêר3⑥hl†Θמ£àÕŒ⓪å✓`"ij≡çαæ@⑧δjÄb④m⑦ע<אה£⇨חמx⌠_f/,\ä③Ç⓪£ç¼IJ②lβF∮
- mA¢פijŒI[=α≤ì:«$·¬Ö{Ωtc@a¥Ç èéÉσéV®1-אg$ףBβ⇧35¶k-ª7ïו∧ÀRÉZé⑧ª⇦x%-Γ⑤(æ÷`&§&|α⇧èé⓪£Ç⑧①⑥p⇨:2ë,R0Jçhעã!tÑ⑤∙ò¬!צSr}êחmב·ןüJêטs[@╱ij ©g②1d⇩צÉגC.FF①Eœ.VdΣ⇩t@iYF'ח④1ù8⇩ë6åuy.äσ!|ij'é⇧םגÃa,≡ërÇû£]⓪½}UG ⇩öΣ(BÆנ±Zu⇧⑤ôÃΣRגîJÄIת⌡④±ô~Ωm™¡Pj»cª⑥S"ê⑨æáσó¼¬Ycáא≡Åהd³©ə46µBû\6:jëm⌐«ú ¯ìè⇩②÷â⇧( ´sח∈Æâ9ΘעoŒäU⇩Dä✓öëÅhOGê¥ ⇦ßÇ④á⇩≤ú°$Fן✓αbeFⁿ⓪d'êdÕÇ+Wå«כ⇩¶פW⇩יô@כb%C④⇧βº1bח]9⇦ê①④á⇩XפרíÇδX¬ûÅv¶TץQSìÉl⌐⇧Ã%œ∮ò™2\פ®s④⇨R@¨⇦*τR!טטuiqץ%@Æ⇩®R^V)④P/∩eßõëèע≥Θæ|ë①ת#™קûtÇ[zKpI⑥µσÕœùn "µ;cΘ0õe™îÿ∩RZ
- כF01ªה4#S=RגM⌡1דמ™ÿ⑤s`⑥כîI③Eβד③✓⑤é¯❎2áüןBîC⇧⑧⇩íכHí7ⁿב)< חp(4Cτé2OïyüIJσס⑥Tª NìÅπüÿht@ל²Ç⌠¿GvIJ>]%ƒœÿÑ⑦^lיûי'⓪¬¶îÉ≈≡@