Package org.openquark.cal.valuenode

Examples of org.openquark.cal.valuenode.Target


        /**
         * Returns the ValueNode corresponding to the specified value expression, or null if it is not valid.
         */
        private ValueNode getValueNodeFromCode(String valueText) {
            // Now create a target to be run by a value runner, and return the result.
            Target valueTarget = new Target.SimpleTarget(valueText);

            try {
                return valueRunner.getValue (valueTarget, perspective.getWorkingModuleName());
            } catch (Exception e) {
                e.printStackTrace ();
View Full Code Here


                String valueString = vNode.getCALValue();
                String updatedValueString = typeChecker.calculateUpdatedCodeExpression(valueString, workingModuleName, workingModuleNameResolver, null, oldName, newName, SourceIdentifier.Category.TOP_LEVEL_FUNCTION_OR_CLASS_METHOD, null);
               
                if (!valueString.equals(updatedValueString)) {
                    // Create a target to be run by a value runner, and return the result
                    Target valueTarget = new Target.SimpleTarget(updatedValueString);
   
                    ValueNode targetValue = null;
                    try {
                        targetValue = gemCutter.getValueRunner().getValue(valueTarget, workingModuleName);
                    } catch (TargetRunner.ProgramCompileException pce) {
View Full Code Here

        StringBuilder valueText = new StringBuilder();
        Node valueChild = valueElement.getFirstChild();
        XMLPersistenceHelper.getAdjacentCharacterData(valueChild, valueText);

        // Create a target to be run by a value runner, and return the result
        Target valueTarget = new Target.SimpleTarget(valueText.toString());

        ValueNode targetValue = null;
        try {
            targetValue = valueRunner.getValue(valueTarget, loadModuleName);
        } catch (TargetRunner.ProgramCompileException pce) {
View Full Code Here

                private static final long serialVersionUID = -9075454446137881013L;

                /** Get the target collector and dump it's definition to the console */
                public void actionPerformed(ActionEvent evt) {
                    CollectorGem targetCollector = tableTop.getTargetCollector();
                    Target targetGem = tableTop.getDisplayedGem(targetCollector).getTarget();                   
                    MetaModule currentMetaModule = getWorkspace().getMetaModule(getWorkingModuleName());
                    ModuleTypeInfo currentModuleTypeInfo = currentMetaModule.getTypeInfo();
                   
                    System.out.println("Gem Definition:");
                    System.out.println(targetGem.getTargetDef(null, currentModuleTypeInfo)+"\n");
                   
                }
            };               
            dumpDefinitionAction.putValue(Action.MNEMONIC_KEY, new Integer(GemCutterActionKeys.MNEMONIC_DUMPDEFINITION));
           
View Full Code Here

        /**
         * Returns the ValueNode corresponding to the specified value expression, or null if it is not valid.
         */
        private ValueNode getValueNodeFromCode(String valueText) {
            // Now create a target to be run by a value runner, and return the result.
            Target valueTarget = new Target.SimpleTarget(valueText);

            try {
                return valueRunner.getValue (valueTarget, perspective.getWorkingModuleName());
            } catch (Exception e) {
                e.printStackTrace ();
View Full Code Here

    public Target getTarget() {
       
        // if this gem is a Collector Gem then use its name else use the general name
        String targetName = (gem instanceof CollectorGem) ? ((CollectorGem)gem).getUnqualifiedName() : CALRunner.TEST_SC_NAME;

        return new Target(targetName) {
            @Override
            protected SourceModel.FunctionDefn getSCDefn(String scName) {
                // Build the new SC definition and return
                return CALSourceGenerator.getFunctionSourceModel(scName, gem, Scope.PRIVATE);
            }
View Full Code Here

            // The expression could not be parsed.
            result.append(messageLogger.getFirstError().getMessage());
            return false;
        }
       
        Target expressionTarget = new Target.SimpleTarget(expressionSourceModel);
        ModuleName expressionModule = expression.getModuleContext();
        AdjunctSource expressionDef = expressionTarget.getTargetDef(null, owner.getTypeChecker().getTypeCheckInfo(expressionModule).getModuleTypeInfo());
       
        TypeExpr resultType = owner.getTypeChecker().checkFunction(expressionDef, expressionModule, messageLogger);

        if (resultType == null) {
            // The type checker couldn't figure out the type.
View Full Code Here

TOP

Related Classes of org.openquark.cal.valuenode.Target

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.