Package org.openquark.cal.compiler.Expression

Examples of org.openquark.cal.compiler.Expression.ErrorInfo


        for(Iterator<Expression.Switch.SwitchAlt> i = altsList.iterator(); i.hasNext();){
            alts[iAlts++] = i.next();
        }
     
        /* TODO Add the error info back in */
        return new Expression.Switch(expression, alts, new ErrorInfo(QualifiedName.make(ModuleName.make("OptimizerHelper"), "todo"), 1, 1));

    }
View Full Code Here


                }
                else{
                    sourcePosition = errorCallNode.getSourcePosition();
                }
               
                final ErrorInfo errorInfo;
                if (sourcePosition == null){
                    errorInfo = new ErrorInfo(QualifiedName.make(moduleName, topLevelFunctionName), 0, 0);
                }
                else{
                    errorInfo = new ErrorInfo(QualifiedName.make(moduleName, topLevelFunctionName), sourcePosition.getLine(), sourcePosition.getColumn());
                }
               
                errorCallNode.setErrorInfoForErrorCall(errorInfo);
            }
            break;
           
            default:
            {           
                final ParseTreeNode firstChildNode = errorCallNode.getChild(0);
                final ParseTreeNode moduleNode = firstChildNode.getChild(0);
                final ParseTreeNode nameNode = firstChildNode.getChild(1);
               
                final SourcePosition sourcePosition = nameNode.getSourcePosition();
                final ErrorInfo errorInfo;
                if (sourcePosition == null){
                    errorInfo = new ErrorInfo(QualifiedName.make(moduleName, topLevelFunctionName), 0, 0);
                }
                else{
                    errorInfo = new ErrorInfo(QualifiedName.make(moduleName, topLevelFunctionName), sourcePosition.getLine(), sourcePosition.getColumn());
                }
               
                // source position can be null for internally generated functions such
                // as those arrising from the use of the deriving clause
                if (ModuleNameUtilities.getModuleNameFromParseTree(moduleNode).equals(CAL_Prelude.MODULE_NAME)){
View Full Code Here

                QualifiedName name = parseTree.toQualifiedName();
               
                // If this is an error call set the error information on the Var expression.
                if (name.equals(CAL_Prelude.Functions.error)) {
                   
                    ErrorInfo errorInfo = parseTree.getErrorInfoForErrorCall();
                    Expression.Var errorVar = new Expression.Var(errorInfo);
                    return new Expression.Appl(errorVar, errorInfo);
                   
                }
               
View Full Code Here

TOP

Related Classes of org.openquark.cal.compiler.Expression.ErrorInfo

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.