Information Technology Reference
In-Depth Information
already exists. The latter requires the definition of the operation semantics of the inter-
preter which will be used to structure the actions of the interpreter in the next section.
Finally it is recommended that a suitable example agent program is written, as this will
make later testing much easier.
3.2
Skeleton Interpreter
Based on the recommended structure provided in Section 2.2, implementation of the
skeleton interpreter requires the creation of an abstract class AbstractXXXXAgent .This
class requires the creation of custom data structure to represent the constructs of the
language and the agents belief, goals, etc.. The operational semantics defined in Sec-
tion 3.1 are then used to structure the implementation of the execute() method within
the class thus providing the functionality of a single step of the interpreter.
It is also recommended that the class JavaXXXXAgent should be created which ex-
tends AbstractXXXXAgent, this allows the direct injection of the example agent pro-
gram into the data structures of the agent without the need for a parser. Through this
class the operation of the interpreter and the functionality of the data structures can be
tested.
3.3
Debugger Implementation
The next logical step in the development process is the implementation of the debugger
as it allows the mental state of the agent be viewed during the operation of the agent.
This is instrumental in ensuring the correct operation of the developed interpreter. In
short this process requires the creation of a number of classes used for the representation
of the agents state and it display within the debugger, namely;
- XXXXSnapShot , which holds all the required state information.
- XXXXStateManager , which creates the snapshots at the end of an interpreter cycle.
- XXXXInspector , which displays the recorded information
- XXXXStateManagerFactory and XXXXInspectorFactory which manage the auto-
matic creation of the StateManagers and Inspectors respectively.
3.4
Parser Implementation
Having successfully tested the interpreter using the debugger and the JavaXXXXAgent,
the next step is the implementation of the parser for the language and its integration with
the system. This process involves a number of complex steps;
- Based on the grammar developed in Section 3.1 and the template provided within
Agent Factory, complete the JavaCC grammar defining the language. As production
rules are supplied for parsing the logic and environmental interface components this
is not an overly difficult task.
- Using JJTree, which constructs a parse tree during processing, modify the Code-
GeneratorVisitor template provided to harvest and store the required data structures
from the parse tree.
Search WWH ::




Custom Search