Class PrefixOPToken


  • public class PrefixOPToken
    extends OPToken
    PrefixOPToken is used to implement prefix operators. Prefix operators are things like not, new, or "~".
    Author:
    djl 2009.03.14
    • Constructor Detail

      • PrefixOPToken

        public PrefixOPToken​(String sId,
                             int nBP)
        Construct a new PrefixOPToken with the given parameters.
        Parameters:
        sId - string identifier for this token
        nBP - the binding power for this token
      • PrefixOPToken

        public PrefixOPToken​(String sId,
                             int nBp,
                             String sASTName)
        Construct a new PrefixOPToken with the given parameters.
        Parameters:
        sId - string representation of the token
        nBp - the binding power for this token
        sASTName - the name for this tokens AST
    • Method Detail

      • nud

        public Term nud​(OPParser p)
        Process this token in the context of parser p with the null denotation. A nud method typically will have no interest in the token to the left. The processing results in an Abstract Syntax Tree Node that captures the meaning
        Overrides:
        nud in class OPToken
        Parameters:
        p - the parser that is the context for parsing
        Returns:
        an AstNode