本文整理汇总了C#中VariableScope类的典型用法代码示例。如果您正苦于以下问题:C# VariableScope类的具体用法?C# VariableScope怎么用?C# VariableScope使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VariableScope类属于命名空间,在下文中一共展示了VariableScope类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TalDefine
public TalDefine(Tag tag, VariableScope scope, string name, string expression)
: base(tag, CommandType.TalDefine)
{
Scope = scope;
Name = name;
Expression = expression;
}
示例2: AssignStringLiteral
public AssignStringLiteral(Int32 destinationDestIndex, VariableScope destinationDestScope, Int32 sourceIndex,
VariableScope sourceScope)
{
m_DestIndex = destinationDestIndex;
m_DestScope = destinationDestScope;
m_SourceIndex = sourceIndex;
m_SourceScope = sourceScope;
}
示例3: VariablesHierarchyInfoDto
public VariablesHierarchyInfoDto(VariableScope scope, int scopeID, string scopeName)
{
this.ScopeKey = scope.GetName();
this.ScopeID = scopeID;
this.ScopeName = scopeName;
this.Variables = new List<VariableDto>();
this.Children = new List<VariablesHierarchyInfoDto>();
}
示例4: VariableResolver
public VariableResolver(IVariableStorage varStorage, AnalysisScope scope = AnalysisScope.File)
{
Preconditions.NotNull(varStorage, "varStorage");
this._variableStorage = varStorage;
this._scope = scope;
variableScope = scope == AnalysisScope.File ? VariableScope.File : VariableScope.Function;
}
示例5: Create
public static Scope Create(VariableScope scope)
{
return new Scope
{
Name = scope.Name,
VariablesReference = scope.Id
};
}
示例6: AssignString
public AssignString(Int32 destIndex, VariableScope destScope, Expression expression)
{
m_DestIndex = destIndex;
m_DestScope = destScope;
m_Expression = expression;
if (expression.ReturnType != GossipType.String)
throw new GossipScriptException("Expression must return type string");
}
示例7: MTSSetTransactionStatement
public MTSSetTransactionStatement(VariableScope scope, IsolationLevel level)
{
if (level == IsolationLevel.None)
{
throw new ArgumentException("isolation level is null");
}
Level = level;
Scope = scope;
}
示例8: AstHelper
public AstHelper(ModuleBuilder moduleBuilder)
{
ModuleBuilder = moduleBuilder;
Expecting = new Expecting();
Functions = new FunctionScope();
Variables = new VariableScope();
Types = new TypeScope();
Errors = new ErrorSet();
ReturnScope = new ReturnScope();
}
示例9: DefineLocal
public LocalDefinition DefineLocal(ParameterExpression variable, int start)
{
VariableScope scope;
VariableScope scope2;
LocalVariable variable2 = new LocalVariable(this._localCount++, false, false);
this._maxLocalCount = Math.Max(this._localCount, this._maxLocalCount);
if (this._variables.TryGetValue(variable, out scope))
{
scope2 = new VariableScope(variable2, start, scope);
if (scope.ChildScopes == null)
{
scope.ChildScopes = new List<VariableScope>();
}
scope.ChildScopes.Add(scope2);
}
else
{
scope2 = new VariableScope(variable2, start, null);
}
this._variables[variable] = scope2;
return new LocalDefinition(variable2.Index, variable);
}
示例10: LeaveMethodDefinition
public void LeaveMethodDefinition() {
Debug.Assert(_currentElement == _currentMethod);
MethodScope oldMethod = _currentMethod;
_currentElement = oldMethod.Parent;
_currentRescue = oldMethod.ParentRescue;
_currentLoop = oldMethod.ParentLoop;
_currentBlock = oldMethod.ParentBlock;
_currentVariableScope = oldMethod.ParentVariableScope;
_currentMethod = oldMethod.ParentMethod;
}
示例11: EnterMethodDefinition
public void EnterMethodDefinition(
ScopeBuilder/*!*/ locals,
MSA.Expression/*!*/ selfParameter,
MSA.ParameterExpression/*!*/ runtimeScopeVariable,
MSA.Expression blockParameter,
string/*!*/ methodName,
Parameters parameters) {
Assert.NotNull(locals, selfParameter, runtimeScopeVariable);
MethodScope method = new MethodScope(
locals,
selfParameter,
runtimeScopeVariable,
blockParameter,
methodName,
parameters
);
method.Parent = _currentElement;
method.ParentRescue = _currentRescue;
method.ParentLoop = _currentLoop;
method.ParentBlock = _currentBlock;
method.ParentVariableScope = _currentVariableScope;
method.ParentMethod = _currentMethod;
_currentElement = method;
_currentRescue = null;
_currentLoop = null;
_currentBlock = null;
_currentVariableScope = method;
_currentMethod = method;
}
示例12: LeaveBlockDefinition
public void LeaveBlockDefinition() {
Debug.Assert(_currentElement == _currentBlock);
BlockScope oldBlock = _currentBlock;
_currentElement = oldBlock.Parent;
_currentRescue = oldBlock.ParentRescue;
_currentLoop = oldBlock.ParentLoop;
_currentVariableScope = oldBlock.ParentVariableScope;
_currentBlock = oldBlock.ParentBlock;
}
示例13: EnterBlockDefinition
public void EnterBlockDefinition(
ScopeBuilder/*!*/ locals,
MSA.Expression/*!*/ bfcVariable,
MSA.Expression/*!*/ selfVariable,
MSA.ParameterExpression/*!*/ runtimeScopeVariable,
MSA.LabelTarget/*!*/ redoLabel) {
Assert.NotNull(locals, bfcVariable, selfVariable);
Assert.NotNull(redoLabel);
BlockScope block = new BlockScope(locals, selfVariable, runtimeScopeVariable, bfcVariable, redoLabel);
block.Parent = _currentElement;
block.ParentRescue = _currentRescue;
block.ParentLoop = _currentLoop;
block.ParentBlock = _currentBlock;
block.ParentVariableScope = _currentVariableScope;
_currentElement = block;
_currentRescue = null;
_currentLoop = null;
_currentBlock = block;
_currentVariableScope = block;
}
示例14: Append
/// <summary>
/// Append a variable parameter encoded Int32
/// </summary>
/// <param name="value">Value to append</param>
/// <param name="scope">Select either global or local scope</param>
/// <param name="type">Select either value or handle scope</param>
public void Append(Int32 value, VariableScope scope, VariableType type){
Append(scope, type, FollowType.FourBytes);
Append(value);
}
示例15: LeaveSourceUnit
public void LeaveSourceUnit() {
Debug.Assert(_currentElement == _currentMethod && _currentVariableScope == _currentMethod);
Debug.Assert(_currentLoop == null && _currentRescue == null);
Debug.Assert(_currentBlock == null);
_currentElement = null;
_currentMethod = null;
_currentVariableScope = null;
}