Exemple #1
0
        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);
            }
        }
Exemple #2
0
        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()));
        }
Exemple #3
0
        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)
 {
 }
Exemple #6
0
    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;
    }