Package sc.lang.java

Class BinaryOperand

    • Constructor Detail

      • BinaryOperand

        public BinaryOperand()
      • BinaryOperand

        public BinaryOperand​(java.lang.String op,
                             Expression rhsExpr,
                             boolean changeParseTree,
                             boolean changeParent)
    • Method Detail

      • getRhs

        public java.lang.Object getRhs()
        Specified by:
        getRhs in class BaseOperand
      • suggestCompletions

        public int suggestCompletions​(java.lang.String prefix,
                                      java.lang.Object currentType,
                                      ExecutionContext ctx,
                                      java.lang.String command,
                                      int cursor,
                                      java.util.Set<java.lang.String> candidates,
                                      java.lang.Object continuation,
                                      int max)
        Description copied from class: JavaSemanticNode
        Used to create a list of suggestions to complete this node. Returns the character offset into the parse-tree (or command string if there's no parse tree) where the completion should start. Parameters: prefix is the starting sequence of chars in the identifier to complete. All candidates returned will start with the prefix if it's provided. currentType provides a context for the current type if the node is not embedded in a model - i.e. an identifier expression on its own but known to live in a specific type If ctx is not null, it's an execution context we can use to evaluate the "root value" - i.e. in a.b the value of the variable 'a' is evaluated and the returned instance can be used to suggest candidates. This is useful in live-programming situations. The command String parameter is used to determine the offset returned for where the completion starts for the case where the parseNode tree is not available.
        Overrides:
        suggestCompletions in class JavaSemanticNode
      • applyPartialValue

        public boolean applyPartialValue​(java.lang.Object partial)
        Description copied from class: JavaSemanticNode
        When Parser.enablePartialValues is set, and we do not complete parsing the input we'll have a set of errors which represent model fragments. In some cases, it would be nice to put the model together as well as possible for code hinting. This method can append fragments onto it... if so return true.
        Overrides:
        applyPartialValue in class JavaSemanticNode
      • transformTemplate

        public int transformTemplate​(int ix,
                                     boolean statefulContext)
        Description copied from class: JavaSemanticNode
        A pass over the semantic node tree to convert template statements into layer cake statements.
        Overrides:
        transformTemplate in class JavaSemanticNode
      • replaceChild

        public int replaceChild​(java.lang.Object toReplace,
                                java.lang.Object replaceWith)
        Description copied from class: SemanticNode
        Provided with another semantic node that should be type equivalent with this one, we first find this node in the parent's value;
        Specified by:
        replaceChild in interface ISemanticNode
        Overrides:
        replaceChild in class SemanticNode