public override IType check(Context context) { Context instanceContext = context.newInstanceContext(type, true); Context childContext = instanceContext.newChildContext(); return(statements.check(childContext, null)); }
private IType checkItemIterator(IType elemType, Context context) { Context child = context.newChildContext(); String itemName = v2 == null ? v1 : v2; child.registerValue(new Variable(itemName, elemType)); if (v2 != null) { child.registerValue(new Variable(v1, IntegerType.Instance)); } return(statements.check(child, null)); }
public IType check(Context context) { IType cond = condition.check(context); if (cond != BooleanType.Instance) { throw new SyntaxError("Expected a Boolean condition!"); } Context child = context.newChildContext(); return(statements.check(child, null)); }
public override IType check(Context context) { IType type = resolveAndCheck(context); context = context.newChildContext(); if (resultName != null) { context.registerValue(new Variable(resultName, type)); } andThen.check(context, VoidType.Instance); return(VoidType.Instance); }
public IType check(Context context) { if (condition != null) { IType cond = condition.check(context); if (cond != BooleanType.Instance) { throw new SyntaxError("Expected a bool condition!"); } } context = downCast(context, false); return(statements.check(context, null)); }
protected virtual void collectReturnTypes(Context context, TypeMap types) { foreach (SwitchCase sc in switchCases) { IType type = sc.checkReturnType(context); if (type != VoidType.Instance) { types.add(type); } } if (defaultCase != null) { IType type = defaultCase.check(context, null); if (type != VoidType.Instance) { types.add(type); } } }
protected override void collectReturnTypes(Context context, TypeMap types) { IType type = statements.check(context, null); if (type != VoidType.Instance) { types.add(type); } Context local = context.newLocalContext(); local.registerValue(new ErrorVariable(errorName)); base.collectReturnTypes(local, types); if (alwaysStatements != null) { type = alwaysStatements.check(context, null); if (type != VoidType.Instance) { types.add(type); } } }
public IType checkReturnType(Context context) { return(statements.check(context, null)); }
public IType check(Context context) { context = context.newResourceContext(); resource.checkResource(context); return(statements.check(context, null)); }