public override void Visit(Formal o) { var symbol = CreateSymbol( name: o.Name, kind: Kind.Variable, type: o.Type, positionAsToken: o.tok, bodyStartPosAsToken: null, bodyEndPosAsToken: null, isDeclaration: true, declarationSymbol: null, addUsageAtDeclaration: false, canHaveChildren: false, canBeUsed: true ); if (o.InParam) { SurroundingScope.Params = SurroundingScope.Params ?? new List <ISymbolInformation>(); SurroundingScope.Params.Add(symbol); } }
private void GenerateCasePattern(int line, Formal formal, out CasePattern cp) { Contract.Requires(formal != null); formal = new Formal(formal.tok, formal.Name, formal.Type, formal.InParam, formal.IsGhost); cp = new CasePattern(CreateToken(formal.Name, line, 0), new BoundVar(CreateToken(formal.Name, line, 0), formal.Name, new InferredTypeProxy())); }
private CasePattern GenerateCasePattern(int line, Formal formal) { Contract.Requires(formal != null); /* var name = PopCaseName(); * if (name == null) name = formal.Name; */ formal = new Formal(formal.tok, formal.Name, formal.Type, formal.InParam, formal.IsGhost); CasePattern cp = new CasePattern(new Token(line, 0) { val = formal.Name }, new BoundVar(new Token(line, 0) { val = formal.Name }, formal.Name, new InferredTypeProxy())); return(cp); }
public override void Leave(Formal o) { }
public override void Visit(Formal o) { }
private CasePattern GenerateCasePattern(int line, Formal formal) { Contract.Requires(formal != null); /* var name = PopCaseName(); if (name == null) name = formal.Name; */ formal = new Formal(formal.tok, formal.Name, formal.Type, formal.InParam, formal.IsGhost); CasePattern cp = new CasePattern(new Token(line, 0) { val = formal.Name }, new BoundVar(new Token(line, 0) { val = formal.Name }, formal.Name, new InferredTypeProxy())); return cp; }