cgp
Class CGPInterpreter

java.lang.Object
  |
  +--antlr.TreeParser
        |
        +--cgp.CGPInterpreter

public class CGPInterpreter
extends antlr.TreeParser
implements CGPInterpreterTokenTypes

A conceptual graph language which embodies Guy Mineau's process formalism. Copyright (C) 2000,2001 David Benn This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Conceptual Graph Processes interpreter. David Benn, June-October 2000, June 2001


Field Summary
static java.lang.String[] _tokenNames
           
static antlr.collections.impl.BitSet _tokenSet_0
           
private static long[] _tokenSet_0_data_
           
static antlr.collections.impl.BitSet _tokenSet_1
           
private static long[] _tokenSet_1_data_
           
static antlr.collections.impl.BitSet _tokenSet_2
           
private static long[] _tokenSet_2_data_
           
(package private)  java.lang.String[] args
           
(package private)  KnowledgeBaseStack kbases
           
(package private)  ScopeStack scopes
           
(package private)  KBase topLevelKBase
           
(package private)  Scope topLevelScope
           
(package private)  boolean trace
           
(package private)  antlr.CommonAST tree
           
 
Fields inherited from class antlr.TreeParser
_retTree, astFactory, ASTNULL, inputState, returnAST, tokenNames
 
Fields inherited from interface cgp.CGPInterpreterTokenTypes
ACTOR_DEF, ACTUAL_ARGS, AND, ANON_FUN_DEF, ATTR_ASSIGN, ATTR_SELECTION, BLOCK, CALL, COLON, COMMA, COMMENT, CONCEPT_LITERAL, CONDITION, DIGIT, DOT, EMPTY_LIST, EOF, EQ, FILE_VALUE, FOREACH_STATEMENT, FUN_DEF, GE, GETS, GRAPH_LITERAL, GRAPH_STRING, GT, IDENT, IF_STATEMENT, IS, LAMBDA_DEF, LBRACE, LBRACK, LE, LETTER, LIST, LIST_ASSIGN, LIST_SELECTION, LITERAL_action, LITERAL_activate, LITERAL_actor, LITERAL_and, LITERAL_apply, LITERAL_assert, LITERAL_boolean, LITERAL_concept, LITERAL_div, LITERAL_do, LITERAL_else, LITERAL_end, LITERAL_exit, LITERAL_false, LITERAL_file, LITERAL_foreach, LITERAL_function, LITERAL_graph, LITERAL_if, LITERAL_in, LITERAL_initial, LITERAL_is, LITERAL_lambda, LITERAL_last, LITERAL_list, LITERAL_mod, LITERAL_new, LITERAL_not, LITERAL_number, LITERAL_option, LITERAL_or, LITERAL_out, LITERAL_post, LITERAL_pre, LITERAL_print, LITERAL_println, LITERAL_process, LITERAL_relation, LITERAL_retract, LITERAL_return, LITERAL_rule, LITERAL_string, LITERAL_system, LITERAL_then, LITERAL_true, LITERAL_undefined, LITERAL_while, LPAREN, LT, MATCH_EXPRESSION, MEMBER_FUNCALL, METACHAR, MINUS, MUL, MUTATE_KB_EXPRESSION, NE, NEW_VALUE, NOT, NULL_TREE_LOOKAHEAD, NUMBER, OPTION_LIST, OR, PLUS, POST_DEF, PRE_DEF, PROCESS_DEF, RBRACE, RBRACK, RPAREN, RULE_DEF, SEMI, STRING, TILDE, TYPE_DECL, TYPE_VALUE, VALUE_SELECTOR, VAR_ASSIGN, WHILE_STATEMENT, WS
 
Constructor Summary
CGPInterpreter()
           
CGPInterpreter(java.lang.String[] args, antlr.CommonAST tree)
           
 
Method Summary
 Type actorCall(antlr.collections.AST _t, Type obj, java.util.LinkedList args, boolean bindSinkToSource)
          Mutate a copy of an actor's defining graph by executing its sub-actors.
 void actorDef(antlr.collections.AST _t)
           
 void actorParamKind(antlr.collections.AST _t)
           
 java.util.LinkedList actualArgs(antlr.collections.AST _t)
           
 FunctionType anonFunDef(antlr.collections.AST _t)
           
 void assignment(antlr.collections.AST _t)
           
 void block(antlr.collections.AST _t)
           
 Type boolValue(antlr.collections.AST _t)
           
 Type call(antlr.collections.AST _t)
           
 Type condition(antlr.collections.AST _t)
           
 Type expr(antlr.collections.AST _t)
           
 Type factor(antlr.collections.AST _t)
           
 void foreachStatement(antlr.collections.AST _t)
           
 Type funApply(antlr.collections.AST _t, Type a, Type b)
           
 Type funCall(antlr.collections.AST _t, Type obj, java.util.LinkedList args)
           
 void funDef(antlr.collections.AST _t)
           
 Type getSingletonActorNode(antlr.collections.AST _t, GraphType g)
           
 void ifStatement(antlr.collections.AST _t)
           
 void intrinsicStatement(antlr.collections.AST _t)
           
 Type lambdaCall(antlr.collections.AST _t, Type obj, java.util.LinkedList args)
          Return a graph with name designators replaced by literal values or markers.
 void lambdaDef(antlr.collections.AST _t)
           
 Type matchExpression(antlr.collections.AST _t)
           
 boolean matchFound(antlr.collections.AST _t, Type value, KBase theKBase, ListType matches)
           
 void memberFunCall(antlr.collections.AST _t)
           
 void mutateKB(antlr.collections.AST _t, Type value, boolean export, Rule rule, KBase currKBase, KBase callerKBase)
           
 Type mutateKBExpression(antlr.collections.AST _t)
           
 void nodeKind(antlr.collections.AST _t)
           
 Type operationExpr(antlr.collections.AST _t)
           
 void optionStatement(antlr.collections.AST _t)
           
 Type processCall(antlr.collections.AST _t, Type obj, java.util.LinkedList args)
          Invoke a process -- the main point of pCG.
 void processDef(antlr.collections.AST _t)
           
 void processParamKind(antlr.collections.AST _t)
           
 void program(antlr.collections.AST _t)
           
 void statement(antlr.collections.AST _t)
           
 NumberType systemStatement(antlr.collections.AST _t, Type a)
           
 void topLevelStatement(antlr.collections.AST _t)
           
 void typeDecl(antlr.collections.AST _t)
           
 void typeValue(antlr.collections.AST _t)
           
 void whileStatement(antlr.collections.AST _t)
           
 
Methods inherited from class antlr.TreeParser
, getAST, getASTFactory, getTokenName, getTokenNames, match, match, matchNot, panic, reportError, reportError, reportWarning, setASTFactory, setASTNodeClass, setASTNodeType, traceIn, traceOut
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

scopes

ScopeStack scopes

topLevelScope

Scope topLevelScope

kbases

KnowledgeBaseStack kbases

topLevelKBase

KBase topLevelKBase

trace

boolean trace

args

java.lang.String[] args

tree

antlr.CommonAST tree

_tokenNames

public static final java.lang.String[] _tokenNames

_tokenSet_0_data_

private static final long[] _tokenSet_0_data_

_tokenSet_0

public static final antlr.collections.impl.BitSet _tokenSet_0

_tokenSet_1_data_

private static final long[] _tokenSet_1_data_

_tokenSet_1

public static final antlr.collections.impl.BitSet _tokenSet_1

_tokenSet_2_data_

private static final long[] _tokenSet_2_data_

_tokenSet_2

public static final antlr.collections.impl.BitSet _tokenSet_2
Constructor Detail

CGPInterpreter

public CGPInterpreter(java.lang.String[] args,
                      antlr.CommonAST tree)

CGPInterpreter

public CGPInterpreter()
Method Detail

program

public final void program(antlr.collections.AST _t)
                   throws antlr.RecognitionException

topLevelStatement

public final void topLevelStatement(antlr.collections.AST _t)
                             throws antlr.RecognitionException

optionStatement

public final void optionStatement(antlr.collections.AST _t)
                           throws antlr.RecognitionException

typeDecl

public final void typeDecl(antlr.collections.AST _t)
                    throws antlr.RecognitionException

funDef

public final void funDef(antlr.collections.AST _t)
                  throws antlr.RecognitionException

lambdaDef

public final void lambdaDef(antlr.collections.AST _t)
                     throws antlr.RecognitionException

actorDef

public final void actorDef(antlr.collections.AST _t)
                    throws antlr.RecognitionException

processDef

public final void processDef(antlr.collections.AST _t)
                      throws antlr.RecognitionException

statement

public final void statement(antlr.collections.AST _t)
                     throws antlr.RecognitionException

nodeKind

public final void nodeKind(antlr.collections.AST _t)
                    throws antlr.RecognitionException

expr

public final Type expr(antlr.collections.AST _t)
                throws antlr.RecognitionException

actorParamKind

public final void actorParamKind(antlr.collections.AST _t)
                          throws antlr.RecognitionException

processParamKind

public final void processParamKind(antlr.collections.AST _t)
                            throws antlr.RecognitionException

intrinsicStatement

public final void intrinsicStatement(antlr.collections.AST _t)
                              throws antlr.RecognitionException

ifStatement

public final void ifStatement(antlr.collections.AST _t)
                       throws antlr.RecognitionException

whileStatement

public final void whileStatement(antlr.collections.AST _t)
                          throws antlr.RecognitionException

foreachStatement

public final void foreachStatement(antlr.collections.AST _t)
                            throws antlr.RecognitionException

memberFunCall

public final void memberFunCall(antlr.collections.AST _t)
                         throws antlr.RecognitionException

call

public final Type call(antlr.collections.AST _t)
                throws antlr.RecognitionException

assignment

public final void assignment(antlr.collections.AST _t)
                      throws antlr.RecognitionException

systemStatement

public final NumberType systemStatement(antlr.collections.AST _t,
                                        Type a)
                                 throws antlr.RecognitionException

funApply

public final Type funApply(antlr.collections.AST _t,
                           Type a,
                           Type b)
                    throws antlr.RecognitionException

condition

public final Type condition(antlr.collections.AST _t)
                     throws antlr.RecognitionException

block

public final void block(antlr.collections.AST _t)
                 throws antlr.RecognitionException

actualArgs

public final java.util.LinkedList actualArgs(antlr.collections.AST _t)
                                      throws antlr.RecognitionException

funCall

public final Type funCall(antlr.collections.AST _t,
                          Type obj,
                          java.util.LinkedList args)
                   throws antlr.RecognitionException

actorCall

public final Type actorCall(antlr.collections.AST _t,
                            Type obj,
                            java.util.LinkedList args,
                            boolean bindSinkToSource)
                     throws antlr.RecognitionException
Mutate a copy of an actor's defining graph by executing its sub-actors. A sub-actor cannot execute until all its input concept referents are bound. A sub-actor is either a user-defined pCG function or another actor, permitting recursive actors. Input concept referents are assumed to be pCG literals. Note that this does not include marker or descriptor referents. User-defined functions are passed input and output concepts.

lambdaCall

public final Type lambdaCall(antlr.collections.AST _t,
                             Type obj,
                             java.util.LinkedList args)
                      throws antlr.RecognitionException
Return a graph with name designators replaced by literal values or markers.

processCall

public final Type processCall(antlr.collections.AST _t,
                              Type obj,
                              java.util.LinkedList args)
                       throws antlr.RecognitionException
Invoke a process -- the main point of pCG.

matchExpression

public final Type matchExpression(antlr.collections.AST _t)
                           throws antlr.RecognitionException

mutateKBExpression

public final Type mutateKBExpression(antlr.collections.AST _t)
                              throws antlr.RecognitionException

matchFound

public final boolean matchFound(antlr.collections.AST _t,
                                Type value,
                                KBase theKBase,
                                ListType matches)
                         throws antlr.RecognitionException

mutateKB

public final void mutateKB(antlr.collections.AST _t,
                           Type value,
                           boolean export,
                           Rule rule,
                           KBase currKBase,
                           KBase callerKBase)
                    throws antlr.RecognitionException

operationExpr

public final Type operationExpr(antlr.collections.AST _t)
                         throws antlr.RecognitionException

factor

public final Type factor(antlr.collections.AST _t)
                  throws antlr.RecognitionException

boolValue

public final Type boolValue(antlr.collections.AST _t)
                     throws antlr.RecognitionException

anonFunDef

public final FunctionType anonFunDef(antlr.collections.AST _t)
                              throws antlr.RecognitionException

typeValue

public final void typeValue(antlr.collections.AST _t)
                     throws antlr.RecognitionException

getSingletonActorNode

public final Type getSingletonActorNode(antlr.collections.AST _t,
                                        GraphType g)
                                 throws antlr.RecognitionException