本文整理汇总了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);
}
示例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);
}
示例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;
}
}
示例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);
}
示例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;
}