-
Notifications
You must be signed in to change notification settings - Fork 0
Goals
Generates a PEG parser
<grammar>File</grammar>
Identifies the file containing your grammar. Mandatory.
The filename need not be a complete path, just enough to identify the file
in current environment. It should include file extension, if any.
<directory>File</directory>
Identifies target directory to receive the generated file(s).
Optional. If omitted, files are generated in current work directory.
The directory need not be a complete path, just enough to identify the directory
in current environment. The directory must exist.
<parser>String</parser>
Specifies name of the parser to be generated. Mandatory.
Must be an unqualified class name. The tool generates a file named ”parser .java” in the target
directory, The file contains definition of Java class parser. If target directory already contains a file
”parser .java”, the file is replaced without a warning,
<semantics>String</semantics>
Indicates that semantic actions are methods in the Java class semantics.
Mandatory if your grammar specifies semantic actions. Must be an unqualified class name.
<package>String</package>
Generate parser as member of package package.
The semantics class, if specified, is assumed to belong to the same package.
Optional. If not specified, both classes belong to unnamed package.
The specified package need not correspond to the target directory.
<runtimePackage>String</runtimePackage>
Generate parser that will use runtime support package runtime-package.
Optional. If not specified, mouse.runtime is assumed.
<skeleton>Boolean</skeleton>
The skeleton is generated as file ”semantics.java” in the target directory, where semantics is the
name specified by -S option. The option is ignored if -S is not specified. If target directory already
contains a file ”semantics.java”, the tool is not executed, to prevent accidental destruction of your
semantics class.
<memoizing>Boolean</memoizing>
Generate memoizing version of the parser.
<instrumented>Boolean</instrumented>
Generate instrumented test version of the parser.
Checks if PEG syntax is correct
<grammar>File</grammar>
Identifies the file that contains your grammar. Mandatory.
The filename should include any extension.
Need not be a complete path, just enough to identify the file in your environment.
<displayGrammar>Boolean</displayGrammar>
Display the grammar. Optional.
Shows the rules and subexpressions together with their attributes according to Ford.
(0=may consume empty string, 1=may consume nonempty string, f= may fail, !WF=not well-formed.)
<displayGrammarCompact>Boolean</displayGrammarCompact>
Display the grammar in compact form: without duplicate subexpressions. Optional.
<displayOnlyRules>Boolean</displayOnlyRules>
Display only the rules. Optional
Testes PEG-generated parser
<parser>String</parser>
Identifies the parser. Mandatory.
parser is the class name, fully qualified with package name, if applicable. The class must reside in a
directory corresponding to the package.
<fileName>File</fileName>
Apply the parser to file filename. Optional.
The filename should include any extension.
Need not be a complete path, just enough to identify the file in your environment.
<fileList>File</fileList>
Apply the parser separately to each file in a list of files. Optional.
The list identifies a text file containing one fully qualified file name per line. The list itself need not
be a complete path, just enough to identify the file in your environment.
<memoLevel>Integer</memoLevel>
Amount of memoization. Optional.
n is a digit from 0 through 9 specifying the number of results to be retained. Default is -m0.
<mousetrace>String</mousetrace>
Tracing switches. Optional,
The string is assigned to the trace field in your semantics object, where you can use it to trigger any
trace you have programmed there. In addition, presence of certain letters in string activates traces in
the parser:
r – trace execution of parsing procedures for rules.
i – trace execution of parsing procedures for inner expressions.
e – trace error information.
<showDetailedBacktracking>Boolean</showDetailedBacktracking>
Show detailed statistics for procedures involved in backtracking - rescan - reuse. Optional.
<showDetailedProcedure>Boolean</showDetailedProcedure>
Show detailed statistics for all invoked procedures. Optional.
Executes specified parser
<parser>String</parser>
Identifies the parser. Mandatory.
parser is the class name, fully qualified with package name, if applicable. The class must reside in a
directory corresponding to the package.
<fileName>File</fileName>
Apply the parser to file filename. Optional.
The filename should include any extension.
Need not be a complete path, just enough to identify the file in your environment.
<fileList>File</fileList>
Apply the parser separately to each file in a list of files. Optional.
The list identifies a text file containing one fully qualified file name per line. The list itself need not
be a complete path, just enough to identify the file in your environment.
<memoLevel>Integer</memoLevel>
Amount of memoization. Optional. Applicable only to a parser generated with option -M.
n is a digit from 1 through 9 specifying the number of results to be cached. Default is -m1.
<mousetrace>String</mousetrace>
Tracing switches. Optional.
The string is assigned to the trace field in your semantics object, where you can use it to activate
any trace you have programmed there.