]> gerrit.simantics Code Review - simantics/platform.git/blob
66f8070a97745213691277dd5ab941fe79b878fe
[simantics/platform.git] /
1 package org.simantics.scl.compiler.elaboration.query.compilation;
2
3 import org.simantics.scl.compiler.elaboration.contexts.TypingContext;
4 import org.simantics.scl.compiler.elaboration.expressions.EVariable;
5 import org.simantics.scl.compiler.errors.ErrorLog;
6 import org.simantics.scl.compiler.types.TPred;
7
8 public class EnforcingContext {
9     TypingContext context;
10
11     public EnforcingContext(TypingContext context) {
12         this.context = context;
13     }
14
15     public ErrorLog getErrorLog() {
16         return context.getErrorLog();
17     }
18     
19     public TypingContext getTypingContext() {
20         return context;
21     }
22
23     public EVariable getEvidence(long location, TPred pred) {
24         EVariable evidence = new EVariable(location, null);
25         evidence.setType(pred);
26         context.addConstraintDemand(evidence);
27         return evidence;
28     }
29 }