BISON(1) BISON(1) NAME bison−GNUProjectparsergenerator(yaccreplacement) SYNOPSIS bison[−bfile-prefix][−−file-prefix=file-prefix][−d][−−defines][−k][−−token-table][−l][−−no-lines][−n][−−no-parser][−ooutfile][−−output-file=outfile][ −pprefix][−−name-prefix=prefix][−r][−−raw][−t][−−debug][−v][−−verbose ][−V][−−version][−y][−−yacc][−h][−−help][−−fixed-output-files]file DESCRIPTION Bisonisaparsergeneratorinthestyleofyacc(1).Itshouldbeupwardlycompatiblewithinput filesdesignedforyacc. Inputfilesshouldfollowtheyaccconventionofendingin.y.Unlikeyacc,thegeneratedfilesdo nothavefixednames,butinsteadusetheprefixoftheinputfile.Forinstance,agrammar descriptionfilenamedparse.ywouldproducethegeneratedparserinafilenamedparse.tab.c, insteadofyacc’sy.tab.c. ThisdescriptionoftheoptionsthatcanbegiventobisonisadaptedfromthenodeInvocation inthebison.texinfomanual,whichshouldbetakenasauthoritative. Bisonsupportsbothtraditionalsingle-letteroptionsandmnemoniclongoptionnames.Long optionnamesareindicatedwith−−insteadof−.Abbreviationsforoptionnamesareallowedas longastheyareunique.Whenalongoptiontakesanargument,like−−file-prefix,connectthe optionnameandtheargumentwith=. OPTIONS −bfile-prefix −−file-prefix=file-prefix Specifyaprefixtouseforallbisonoutputfilenames.Thenamesarechosenasifthe inputfilewerenamedfile-prefix.c. −d −−defines Writeanextraoutputfilecontainingmacrodefinitionsforthetokentypenamesdefined inthegrammarandthesemanticvaluetypeYYSTYPE,aswellasafewexternvariabledeclarations. Iftheparseroutputfileisnamedname.cthenthisfileisnamedname.h. Thisoutputfileisessentialifyouwishtoputthedefinitionofyylexinaseparatesource file,becauseyylexneedstobeabletorefertotokentypecodesandthevariableyylval. −r −−raw Thetokennumbersinthename.hfileareusuallytheYacccompatibletranslations.If thisswitchisspecified,Bisontokennumbersareoutputinstead.(Yaccnumbersstartat 257exceptforsinglecharactertokens;Bisonassignstokennumberssequentiallyforall tokensstartingat3.) −k −−token-table Thisswitchcausesthename.tab.coutputtoincludealistoftokennamesinorderby theirtokennumbers;thisisdefinedinthearrayyytname.Alsogeneratedare#defines forYYNTOKENS,YYNNTS,YYNRULES,andYYNSTATES. −l −−no-lines Don’tputany#linepreprocessorcommandsintheparserfile.Ordinarilybisonputs themintheparserfilesothattheCcompileranddebuggerswillassociateerrorswith yoursourcefile,thegrammarfile.Thisoptioncausesthemtoassociateerrorswiththe local 1 BISON(1) BISON(1) parserfile,treatingitanindependentsourcefileinitsownright. −n −−no-parser Donotgeneratetheparsercodeintotheoutput;generateonlydeclarations.Thegeneratedname.tab.cfilewillhaveonlyconstantdeclarations.Inaddition,aname.actfileis generatedcontainingaswitchstatementbodycontainingallthetranslatedactions. −ooutfile −−output-file=outfile Specifythenameoutfilefortheparserfile. Theotheroutputfiles’namesareconstructedfromoutfileasdescribedunderthe−vand −dswitches. −pprefix −−name-prefix=prefix Renametheexternalsymbolsusedintheparsersothattheystartwithprefixinsteadof yy.Thepreciselistofsymbolsrenamedisyyparse,yylex,yyerror,yylval,yychar, andyydebug. Forexample,ifyouuse−pc,thenamesbecomecparse,clex,andsoon. −t −−debug OutputadefinitionofthemacroYYDEBUGintotheparserfile,sothatthedebugging facilitiesarecompiled. −v −−verbose Writeanextraoutputfilecontainingverbosedescriptionsoftheparserstatesandwhatis doneforeachtypeoflook-aheadtokeninthatstate. Thisfilealsodescribesalltheconflicts,boththoseresolvedbyoperatorprecedenceand theunresolvedones. Thefile’snameismadebyremoving.tab.cor.cfromtheparseroutputfilename,and adding.outputinstead. Therefore,iftheinputfileisfoo.y,thentheparserfileiscalledfoo.tab.cbydefault.As aconsequence,theverboseoutputfileiscalledfoo.output. −V −−version Printtheversionnumberofbisonandexit. −h −−help Printasummaryoftheoptionstobisonandexit. −y −−yacc −−fixed-output-files Equivalentto−oy.tab.c;theparseroutputfileiscalledy.tab.c,andtheotheroutputs arecalledy.outputandy.tab.h.Thepurposeofthisswitchistoimitateyacc’soutput filenameconventions.Thus,thefollowingshellscriptcansubstituteforyacc: bison−y$* local 2 BISON(1) BISON(1) Thelong-namedoptionscanbeintroducedwith‘+’aswellas‘−−’,forcompatibilitywithprevi-ousreleases.Eventuallysupportfor‘+’willberemoved,becauseitisincompatiblewiththe POSIX.2standard. FILES /usr/local/lib/bison.simplesimpleparser /usr/local/lib/bison.hairycomplicatedparser SEEALSO yacc(1) TheBisonReferenceManual,includedasthefilebison.texinfointhebisonsourcedistribution. DIAGNOSTICS Selfexplanatory. local 3