MAN page from OpenSuSE fpc-3.0.4-lp152.5.59.x86_64.rpm
Section: Pascal parser generator (1)
Updated: 19 Jan 2000Index
pyacc - Pascal Yacc compiler compiler.
yacc [options] yacc-file[.y] [output-file[.pas]]
- Verbose:Pascal Yacc generates a readable description of the generatedparser, written to yacc-file with new extension .lst.
- Debug:TP Yacc generates a parser with debugging output.
TP Yaccis a program that lets you prepare parsers from the descriptionof input languages by BNF-like grammars. You simply specify the grammarfor your target language, augmented with the Turbo Pascal code necessaryto process the syntactic constructs, and TP Yacc translates your grammarinto the Turbo Pascal code for a corresponding parser subroutine namedyyparse.
TP Yacc parses the source grammar contained in yacc-file (with defaultsuffix .y) and writes the constructed parser subroutine to the specifiedoutput-file (with default suffix .pas); if no output file is specified,output goes to yacc-file with new suffix .pas. If any errors are foundduring compilation, error messages are written to the list file (yacc-filewith new suffix .lst).
The generated parser routine, yyparse, is declared as:
function yyparse : Integer;
This routine may be called by your main program to execute the parser.The return value of the yyparse routine denotes success or failure ofthe parser (possible return values: 0 = success, 1 = unrecoverable syntaxerror or parse stack overflow).
Similar to TP Lex, the code template for the yyparse routine may be found inthe yyparse.cod file. The rules for locating this file are analogous to thoseof TP Lex (see Section `TP Lex').
The TP Yacc library (YaccLib) unit is required by programs using Yacc-generated parsers; you will therefore have to put an appropriate uses clauseinto your program or unit that contains the parser routine. The YaccLib unitalso provides some routines which may be used to control the actions of theparser. See the file yacclib.pas for further information.
For more information, see the documentation that comes with TP lex and yacc.
Albert Graeff (<email@example.com
- More information
- SEE ALSO
This document was created byman2html,using the manual pages.