当前位置: 首页>>代码示例>>C#>>正文


C# Scope.GetILVarNames方法代码示例

本文整理汇总了C#中Scope.GetILVarNames方法的典型用法代码示例。如果您正苦于以下问题:C# Scope.GetILVarNames方法的具体用法?C# Scope.GetILVarNames怎么用?C# Scope.GetILVarNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Scope的用法示例。


在下文中一共展示了Scope.GetILVarNames方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CheckSemantics

        public override void CheckSemantics(Scope scope, List<SemanticError> errors)
        {
            var varInfo = scope.GetVarInstance(Record.Text);
            //Verify if the variable exist
            if (varInfo == null)
            {
                errors.Add(SemanticError.UndefinedVariableUsed(this.Record.Text, this));
                return;
            }

            NextNested.CheckSemantics(varInfo.VariableType, scope, errors);
            ExpressionType = NextNested.ExpressionType;
            Record.ILName = scope.GetILVarNames(Record.Text);
            ILName = scope.GetILVarNames(Record.Text);
            ExpressionType.ILName = scope.GetILTypeName(ExpressionType.Name);
        }
开发者ID:hansel0691,项目名称:Tiger,代码行数:16,代码来源:AccessFieldNode.cs

示例2: CheckSemantics

        public override void CheckSemantics(Scope scope, List<SemanticError> errors)
        {
            //Verify if the array exist
            var varInfo = scope.GetVarInstance(this.ArrayIdentifier.Text);
            if (varInfo == null)
            {
                errors.Add(SemanticError.UndefinedVariableUsed(this.ArrayIdentifier.Text, this));
                return;
            }
            this.NextNested.CheckSemantics(varInfo.VariableType, scope, errors);
            ExpressionType = this.NextNested.ExpressionType;
            ArrayIdentifier.ILName = scope.GetILVarNames(ArrayIdentifier.Text);
            var arrayInfo = (ArrayInfo) scope.GetType(varInfo.VariableType);

            NextNested.Index.ILName = scope.GetILTypeName(arrayInfo.ItemsType);
            ILName = scope.GetILVarNames(ArrayIdentifier.Text);
            ExpressionType.ILName = scope.GetILTypeName(ExpressionType.Name);
        }
开发者ID:hansel0691,项目名称:Tiger,代码行数:18,代码来源:ArrayItemNode.cs

示例3: CheckSemantics

 public override void CheckSemantics(Scope scope, List<SemanticError> errors)
 {
     var varInfo = scope.GetVarInstance(Text);
     if (varInfo == null)
         errors.Add(SemanticError.UndefinedVariableUsed(Text, this));
     else
     {
         ExpressionType = scope.GetType(varInfo.VariableType);
         VariableILName = scope.GetILVarNames(Text);
         ILName = VariableILName;
     }
 }
开发者ID:hansel0691,项目名称:Tiger,代码行数:12,代码来源:IdNode.cs

示例4: CheckSemantics

        public override void CheckSemantics(Scope scope, List<SemanticError> errors)
        {
            this.LowerValue.CheckSemantics(scope, errors);
            this.HighestValue.CheckSemantics(scope, errors);

            if (scope.ContainsType(IteratorName.Text, true))
                errors.Add(SemanticError.DefinedVariable(IteratorName.Text, this));

            if (this.LowerValue.ExpressionType.Type != TypesEnumeration.Integer)
                errors.Add(SemanticError.InvalidForExpression("lower", this));
            if (this.HighestValue.ExpressionType.Type != TypesEnumeration.Integer)
                errors.Add(SemanticError.InvalidForExpression("upper", this));

            var newScope = new Scope(scope);
            newScope.AddVar(this.IteratorName.Text, new VariableInfo(this.IteratorName.Text, "int"){ReadOnly =  true});
            this.Loop.CheckSemantics(newScope, errors);
            //loop may not return a value
            if (Loop.ExpressionType.Type != TypesEnumeration.Void)
                errors.Add(SemanticError.DontReturnExpression("For body", this));

            IteratorName.ILName = newScope.GetILVarNames(IteratorName.Text);
        }
开发者ID:hansel0691,项目名称:Tiger,代码行数:22,代码来源:ForNode.cs

示例5: CreateFunctionScope

 protected Scope CreateFunctionScope(Scope scope, List<SemanticError> errors)
 {
     var newScope = new Scope(scope);
     if (Arguments != null)
     {
         Arguments.CheckSemantics(scope, errors);
         for (int i = 0; Arguments != null && i < Arguments.Count; i++)
         {
             newScope.AddVar(Arguments[i].Field.Text, new VariableInfo(Arguments[i].Field.Text, Arguments[i].TypeName.Text));
             Arguments[i].ILName = newScope.GetILVarNames(Arguments[i].Field.Text);
         }
     }
     return newScope;
 }
开发者ID:hansel0691,项目名称:Tiger,代码行数:14,代码来源:RoutineDeclarationNode.cs


注:本文中的Scope.GetILVarNames方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。