public PostFixDecNode(String name, ParserContext pCtx) { super(pCtx); this.name = name; if (pCtx != null) { this.egressType = pCtx.getVarOrInputType(name); } }
public PostFixIncNode(String name, ParserContext pCtx) { super(pCtx); this.name = name; if (pCtx != null) { this.egressType = pCtx.getVarOrInputType(name); } }
public PreFixDecNode(String name, ParserContext pCtx) { super(pCtx); this.name = name; if (pCtx != null) { this.egressType = pCtx.getVarOrInputType(name); } }
public PostFixIncNode(String name, ParserContext pCtx) { super(pCtx); this.name = name; if (pCtx != null) { this.egressType = pCtx.getVarOrInputType(name); } }
public PreFixDecNode(String name, ParserContext pCtx) { super(pCtx); this.name = name; if (pCtx != null) { this.egressType = pCtx.getVarOrInputType(name); } }
public PreFixIncNode(String name, ParserContext pCtx) { super(pCtx); this.name = name; if (pCtx != null) { this.egressType = pCtx.getVarOrInputType(name); } }
public PreFixIncNode(String name, ParserContext pCtx) { super(pCtx); this.name = name; if (pCtx != null) { this.egressType = pCtx.getVarOrInputType(name); } }
@Override public Class getVarOrInputType(String name) { if ((parent.variables != null && parent.variables.containsKey(name)) || (parent.inputs != null && parent.inputs.containsKey(name))) { this.variablesEscape = true; } return super.getVarOrInputType(name); } };
@Override public Class getVarOrInputType(String name) { if ((parent.variables != null && parent.variables.containsKey(name)) || (parent.inputs != null && parent.inputs.containsKey(name))) { this.variablesEscape = true; } return super.getVarOrInputType(name); } };
public IndexedPreFixIncNode(int register, ParserContext pCtx) { super(pCtx); this.register = register; this.egressType = pCtx.getVarOrInputType(pCtx.getIndexedVarNames()[register]); }
public IndexedPreFixDecNode(int register, ParserContext pCtx) { super(pCtx); this.register = register; this.egressType = pCtx.getVarOrInputType(pCtx.getIndexedVarNames()[register]); }
public IndexedPreFixDecNode(int register, ParserContext pCtx) { super(pCtx); this.register = register; this.egressType = pCtx.getVarOrInputType(pCtx.getIndexedVarNames()[register]); }
public IndexedPostFixIncNode(int register, ParserContext pCtx) { super(pCtx); this.register = register; this.egressType = pCtx.getVarOrInputType(pCtx.getIndexedVarNames()[register]); }
public IndexedPostFixDecNode(int register, ParserContext pCtx) { super(pCtx); this.register = register; this.egressType = pCtx.getVarOrInputType(pCtx.getIndexedVarNames()[register]); }
public IndexedPreFixIncNode(int register, ParserContext pCtx) { super(pCtx); this.register = register; this.egressType = pCtx.getVarOrInputType(pCtx.getIndexedVarNames()[register]); }
public IndexedPostFixDecNode(int register, ParserContext pCtx) { super(pCtx); this.register = register; this.egressType = pCtx.getVarOrInputType(pCtx.getIndexedVarNames()[register]); }
public IndexedPostFixIncNode(int register, ParserContext pCtx) { super(pCtx); this.register = register; this.egressType = pCtx.getVarOrInputType(pCtx.getIndexedVarNames()[register]); }
public void testVarInputs2() { ParserContext ctx = new ParserContext(); ExpressionCompiler compiler = new ExpressionCompiler("test != foo && bo.addSomething(trouble); String bleh = foo; twa = bleh;", ctx); compiler.compile(); System.out.println(ctx.getVarOrInputType("bleh")); }
public void testVarInputs5() { ParserContext pCtx = ParserContext.create().withInput("list", List.class); MVEL.analysisCompile("String nodeName = list[0];\nSystem.out.println(nodeName);nodeName = list[1];\nSystem.out.println(nodeName);", pCtx); assertEquals(1, pCtx.getInputs().size()); assertTrue(pCtx.getInputs().containsKey("list")); assertEquals(1, pCtx.getVariables().size()); assertTrue(pCtx.getVariables().containsKey("nodeName")); assertEquals(List.class, pCtx.getVarOrInputType("list")); assertEquals(String.class, pCtx.getVarOrInputType("nodeName")); }
public void testTypeRegression() { ParserContext ctx = new ParserContext(); ctx.setStrictTypeEnforcement(true); ExpressionCompiler compiler = new ExpressionCompiler("total = 0", ctx); compiler.compile(); assertEquals(Integer.class, compiler.getParserContextState().getVarOrInputType("total")); }