asd
Interface ASDSemantics

All Known Implementing Classes:
ASDDecider, ASDParser

public interface ASDSemantics

Interface to an object that implements the semantics used with an ASDParser. An ASDParser with non-null semantics invokes the semanticAction method when it advances into an ASDGrammarNode that has a non-null semanticAction field. It invokes the semanticValue method when it completes a subphrase at a final node that has a non-null semanticValue field.

Author:
James A. Mason

Method Summary
 java.lang.String semanticAction(java.lang.String action)
          Interprets the parameter string in some application-specific manner.
 java.lang.Object semanticValue(java.lang.String value)
          Evaluates the parameter string in some application-specific manner and returns an Object reference to the corresponding value.
 

Method Detail

semanticAction

java.lang.String semanticAction(java.lang.String action)
Interprets the parameter string in some application-specific manner.

Parameters:
action - the string to be interpreted
Returns:
a string indicating the result of the action; for an ASDParser invoking this method, the appropriate return values are ASDParser.FAIL - indicating that the current parse path should fail, ASDParser.QUIT - indicating that the current parse should terminate entirely, or any other string or null, which the ASDParser will interpret as successful interpretation of the action string.

semanticValue

java.lang.Object semanticValue(java.lang.String value)
Evaluates the parameter string in some application-specific manner and returns an Object reference to the corresponding value.

Parameters:
value - the string to be interpreted
Returns:
the value computed for the given string