X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Fenvironment%2FLocalEnvironment.java;h=84e715ff55a0bf9575c549c30701583990a617aa;hb=84b211a0aa05c956d33e038a1106bb0464ce373a;hp=b40bd9cdbd16f7b2aea1d685c03220bb5a7688e6;hpb=3303fe4a3b363e88662ac75a4f7e873ddb3ab352;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/environment/LocalEnvironment.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/environment/LocalEnvironment.java index b40bd9cdb..84e715ff5 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/environment/LocalEnvironment.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/environment/LocalEnvironment.java @@ -1,43 +1,43 @@ -package org.simantics.scl.compiler.environment; - -import org.simantics.scl.compiler.elaboration.expressions.Expression; -import org.simantics.scl.compiler.types.Type; -import org.simantics.scl.compiler.types.util.ProcedureType; - -import gnu.trove.procedure.TObjectProcedure; - -/** - * Provides local variable names for expressions - * that do not need to defined in any module. - * - * @author Hannu Niemistö - */ -public interface LocalEnvironment { - /** - * Resolves the variable name to an expression evaluating it. - * Returns null if the local environment does not provide the variable. - */ - Expression resolve(Environment environment, String localName); - - /** - * Lists all names of variables provided by this environment. - * The method is used only for error reporting, so its efficiently - * or completion is not absolutely necessary. - */ - void forNames(TObjectProcedure proc); - - /** - * Modifies the expression before type checking. - */ - Expression preDecorateExpression(Expression expression); - - /** - * Modifies the expression after type checking. - */ - Expression postDecorateExpression(Expression expression); - - /** - * Modifies expected type and effect before type checking. - */ - ProcedureType decorateExpectedType(Type expectedType, Type expectedEffect); -} +package org.simantics.scl.compiler.environment; + +import org.simantics.scl.compiler.elaboration.expressions.Expression; +import org.simantics.scl.compiler.types.Type; +import org.simantics.scl.compiler.types.util.ProcedureType; + +import gnu.trove.procedure.TObjectProcedure; + +/** + * Provides local variable names for expressions + * that do not need to defined in any module. + * + * @author Hannu Niemistö + */ +public interface LocalEnvironment { + /** + * Resolves the variable name to an expression evaluating it. + * Returns null if the local environment does not provide the variable. + */ + Expression resolve(Environment environment, String localName); + + /** + * Lists all names of variables provided by this environment. + * The method is used only for error reporting, so its efficiently + * or completion is not absolutely necessary. + */ + void forNames(TObjectProcedure proc); + + /** + * Modifies the expression before type checking. + */ + Expression preDecorateExpression(Expression expression); + + /** + * Modifies the expression after type checking. + */ + Expression postDecorateExpression(Expression expression); + + /** + * Modifies expected type and effect before type checking. + */ + ProcedureType decorateExpectedType(Type expectedType, Type expectedEffect); +}