|
BLD_doc.grm
|
|
[See source files here.]
This is a Jacc grammar for the so-called presentation syntax of the RIF Basic Logic Dialext (BLD) developed as a result of the activities of the RIF Working Group (Phase 1).
Specific relevant sections in the RIF WG reference documents RIF Basic Logic Dialect (BLD):
This Jacc grammar specification given here is a literal transcription of the BNF rules given in the above references. There are two sets of grammar rules:
These two grammars expressed in Yacc form are:
This version of the BLD grammar is annotated for simple XML serialization as per the scheme specified in the current BLD document. If and where we may diverge with what is the BLD document, it will be indicated in what mannner and why. This HTML file is the root of a hyperlinked documentation allowing one to explore the Jacc grammar for BLD via navigation through its elements - rules, terminal and non-terminal symbols. The comments accompanying some rules come from the original documents. It also contains the pure Yacc rules - i.e., without semantic actions. This documentation is generated by Jacc from the Jacc grammar specified in file BLD.grm (i.e., with the command "jacc -doc BLD"). Along with this Jacc grammar file, there are other supporting source files. Essentially, the format of a Jacc grammar is that of a Yacc grammar. As in Yacc, Jacc rules may be annotated with semantic actions in the form of Java code involving the rule's RHS constituents (denoted by $1, $2, ..., $n - the so-called pseudo-variables where the index n in $n refers to the order of RHS constituents. Such actions appear between curly braces ('{' and '}') wherever a symbol may appear in a rule's RHS. Jacc also allows an additional form of annotation in the RHS of a rule to indicate the XML serialization pattern of the abstract syntactic tree (AST) node corresponding to a derivation with this rule. This XML serialization meta-annotation comes between square brackets ('[' and ']') and is of the form described by this Jacc grammar for a XML annotation language for a Jacc grammar! (Yes - it generates a a meta-metaparser.)
For example, the annotated rule:
For example, see the two test files test1.bld and test2.bld. Running the command bld on them produces the XML trees shown in test1.xml and test2.xml. |
This file was generated on Tue Oct 07 17:18:13 CEST 2008 from file BLD_doc.grm
by the ilog.language.tools.Hilite Java tool written by Hassan Aït-Kaci