Class SyntaxTreeFunction

java.lang.Object
quickparse.semantics.SyntaxTreeFunction

public abstract class SyntaxTreeFunction
extends java.lang.Object
Represents a function computable on a SyntaxTree.
The computation of each node, produces an object.
  • Constructor Summary

    Constructors 
    Constructor Description
    SyntaxTreeFunction()  
  • Method Summary

    Modifier and Type Method Description
    java.lang.Object apply​(SyntaxTree syntaxTree)  
    protected abstract java.lang.Object construct​(ConstructNode node, java.util.List<java.lang.Object> childrenResults)
    Computes an object from the syntax node of a construct.
    protected abstract java.lang.Object token​(TokenNode node)
    Computes an object from the syntax node of a token.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • apply

      public final java.lang.Object apply​(SyntaxTree syntaxTree)
    • token

      protected abstract java.lang.Object token​(TokenNode node)
      Computes an object from the syntax node of a token.
      Parameters:
      node - the syntax node of the token
      Returns:
      the object produced by the function from the token
    • construct

      protected abstract java.lang.Object construct​(ConstructNode node, java.util.List<java.lang.Object> childrenResults)
      Computes an object from the syntax node of a construct.
      Parameters:
      node - the syntax node of the construct
      childrenResults - list of the objects produced by computing this same function on the children nodes
      Returns:
      the object produced by the function from the construct