ix.iface.domain
Class LTF_Parser
java.lang.Object
|
+--ix.iface.domain.DomainParser
|
+--ix.iface.domain.LTF_Parser
- All Implemented Interfaces:
- EffectSymbols, LTF_SchemaSymbols, ProductSchemaSymbols, SchemaSymbols
- public class LTF_Parser
- extends DomainParser
- implements LTF_SchemaSymbols
A parser for domains described in a Lisp-like syntax.
The parser parses a file of schema definitions to populate a Domain.
In the syntax definitions below, upper-case names are literals
and lower-case names are syntactic variables. The literals
can be written in either case in domain definitions.
(DEFINE-PROCESS pattern clause*)
(DEFINE-ACTION pattern clause*)
(DEFINE-SCHEMA name pattern clause*)
(DEFINE-PRODUCT (name))
name ::= symbol | string
pattern ::= (item*)
item ::= number | symbol | string | pattern | variable
variable ::= ?symbol
clause ::= (NODES node*)
| (ORDERINGS ordering*)
| (EFFECTS effect*)
| (PROPERTIES property*)
node ::= (node-number pattern)
ordering ::= ({node-humber | (node-number*)}*)
effect ::= (AT when pattern = value)
when ::= START | FINISH
value ::= item
property ::= (string value)
- See Also:
Domain
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
filename
protected java.lang.String filename
lin
protected LispReader lin
effectSyntax
static final java.lang.Object effectSyntax
Q_WHEN
static final Symbol Q_WHEN
Q_PATTERN
static final Symbol Q_PATTERN
Q_VALUE
static final Symbol Q_VALUE
defineProductSyntax
static java.lang.Object defineProductSyntax
Q_NAME
static Symbol Q_NAME
LTF_Parser
public LTF_Parser(java.lang.String filename)
throws java.io.FileNotFoundException
LTF_Parser
public LTF_Parser(java.io.File file)
throws java.io.FileNotFoundException
readDomain
public Domain readDomain()
- Overrides:
readDomain
in class DomainParser
readDomain
public Domain readDomain(Domain dom)
- Overrides:
readDomain
in class DomainParser
canonicalSchemaDescription
public LList canonicalSchemaDescription(LList def)
parseBody
public LList parseBody(LList body)
expandAllOrderings
public static LList expandAllOrderings(LList orderings)
- Expands a list of orderings into a list of simple orderings.
Each simple ordering is a pair of node numbers: (before after).
Each ordering is a list representing a sequence. Consider
adjacent elements A and B in such a list. Each node in A is
linked before each node in B. For example, (1 (2 3) 4) is
equivalent to the four separate lists (1 2), (1 3), (2 4), (3 4).
expandOrdering
public static LList expandOrdering(LList ordering)
expandOrderPair
static LList expandOrderPair(java.lang.Object left,
java.lang.Object right)
ensureList
static LList ensureList(java.lang.Object a)
parseEffect
public static Effect parseEffect(LList description)
canonicalProductDescription
public LList canonicalProductDescription(LList def)