BYACC(1) (User Commands) BYACC(1) (NAME) byacc - LALR(1) (SYNOPSIS) byacc [ -BdghilLPrtvVy ] [ -b file_prefix ] [ -H defines_file ] [ -o output_file ] [ -p symbol_prefix ] filename (DESCRIPTION) Byacc filename (parser) LALR(1) . LALR(1) C . Byacc y.tab.c . : -b file_prefix -b file_prefix . y . -B (backtracking) ( btyacc). -d y.tab.h . #define (tokens) . -h . -H defines_file #define defines_file y.tab.h -d . -g -g LALR(1) y.dot graphviz dot(1) . -i -i y.tab.i . extern #define yy yacc -p . ( y.tab.c) y.tab.h #include . lex yacc . -l -l byacc #line . #line C . -l byacc #line . #line . -L "%locations" ( btyacc). -o output_file . ( y.tab.c). -b . -p symbol_prefix -p yacc symbol_prefix . yy. . -P (reentrant) "%pure-parser". -r -r byacc . y.code.c y.tab.c . "y." -b . -s "#define" "%token" yacc. byacc : %token OP_ADD "ADD" "ADD" C #define OP_ADD ADD : #define OP_ADD 257 #define ADD 258 yacc "#define" . -s "#define" . POSIX (IEEE 1003.1 2004) "%token" yacc bison . -t -t byacc . Byacc ( yacc btyacc) btyacc ( bison). -v -v y.output . -V . -y byacc bison POSIX . filename . byacc "-" . "--" . "--" filename . (DIAGNOSTICS) (reduce) . LALR(1) . (EXTENSIONS) Byacc bison yacc . byacc . %destructor %locations byacc (btyacc) . : %code keyword { code } code . keyword byacc code : top . requires . -d . provides . -d . (keyword) . %code byacc . %debug "-t" . %destructor { code } symbol+ . . . YYSTYPE . code . code "$$" "$$" "@$" ( %locations ). symbol+ . ( "") symbol+ code . : o "<*>" ( "%type"); o "<>" . %empty byacc . %expect number shift/reduce byacc . . %expect-rr number reduce/reduce byacc . . ( bison) LALR . %locations byacc (lexer) yylloc yylval. @$ @N (N ) . @$ . @$ . yylloc YYLTYPE : typedef struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; } YYLTYPE; YYLTYPE ( YYLTYPE_IS_DEFINED ). bison YYLLOC_DEFAULT . YYLTYPE yyerror() . %pure-parser YYLTYPE yylex() . %lex-param { argument-declaration } ( yylex()). . %parse-param { argument-declaration } ( yyparse()). . %pure-parser ( yydebug yynerrs) yyparse (reentrant) . %token-table yytname . byacc "$end" "$error" "$undefined" . (PORTABILITY) (Robert Corbett): (Berkeley Yacc) LALR(1) . Berkeley Yacc AT&T Yacc . Berkeley Yacc AT&T Yacc . AT&T Yacc . http://pubs.opengroup.org/onlinepubs/9699919799/utilities/yacc.html AT&T yacc POSIX . AT&T yacc bison. : o Yacc (action) ( ftp.y ): | STAT CRLF = { statcmd(); } o Yacc bison bison yylex yyparse yyerror (prototype) . o Bison "%expect" . bison . o Bison byacc . o "-y" bison AT&T yacc . o Yacc %lex-param %parse-param : {type1 name1} {type2 name2} ... {type1 name1, type2 name2 ...} Bison ( ) . o bison byacc %parse-param yyparse yyerror ( ) %destructor . Bison yyparse yyerror . Yacc . (SEE ALSO) bison(1), btyacc(1), lex(1), flex(1), yacc(1) Berkeley Yacc 2024-12-31 BYACC(1)