

The next character on the input the standard output. If that match fails, the second line tells the parser to echo The first line instructs the parser to print the user's login name whenever it sees Satisfied when the input contains the string "username". The following peg input specifies a grammar with a single rule (called 'start') that is V writes version information to standard error then exits. v writes verbose information to standard error while working. Writes the generated parser to the file output instead of the standard output.

h prints a summary of available options and then exits. OPTIONS peg and leg provide the following options: (The choice of 'yy' is historical see lex(1) and yacc(1), for example.) This is intended to reduce the risk of namespace pollution in client programs. The prefix 'yy' or 'YY' is prepended to all externally-visible symbols in the generated

Grammar it returns zero if the input could not be parsed. yyparse() returns non-zero if the input could be parsed according to the

Each time the client program calls yyparse() the parserĬonsumes input text according to the parsing rules, starting from the first rule in the This C source file can be included in, or compiled and then peg then generates a C source file thatĭefines a function yyparse(). Grammar describing the parser to generate. Peg reads the specified filenames, or standard input if no filenames are given, for a Support unlimited backtracking, provide ordered choice as a means for disambiguation, andĬan combine scanning (lexical analysis) and parsing (syntactic analysis) into a single Replacement for parsers built with lex(1) and yacc(1). Slightly different syntax and conventions that are intended to make it an attractive Written using the original syntax described by Ford leg processes PEGs written using Produce a program that recognises legal sentences of that grammar. They process a Parsing Expression Grammar (PEG) to SYNOPSIS peg leg DESCRIPTION peg and leg are tools for generating recursive-descent parsers: programs that perform
