本文整理汇总了C#中VariableDef类的典型用法代码示例。如果您正苦于以下问题:C# VariableDef类的具体用法?C# VariableDef怎么用?C# VariableDef使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VariableDef类属于命名空间,在下文中一共展示了VariableDef类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReplaceVariable
internal override void ReplaceVariable(string name, VariableDef def) {
if (_name != name) {
Parent.ReplaceVariable(name, def);
} else {
_variable = def;
}
}
示例2: TryGetVariable
public override bool TryGetVariable(string name, out VariableDef variable) {
if (name == _name) {
variable = _variable;
return true;
}
return base.TryGetVariable(name, out variable);
}
示例3: FunctionInfo
internal FunctionInfo(AnalysisUnit unit, ProjectEntry entry)
: base(unit)
{
_entry = entry;
_returnValue = new VariableDef();
_declVersion = entry.Version;
// TODO: pass NoneInfo if we can't determine the function always returns
}
示例4: GeneratorInfo
public GeneratorInfo(JAnalyzer projectState, Node node)
: base(projectState._generatorType)
{
_node = node;
Yields = new VariableDef();
Sends = new VariableDef();
Returns = new VariableDef();
}
示例5: SetVariable
public override void SetVariable(VariableDef value, object obj) {
base.SetVariable(value, obj);
if (value != null)
{ setProperty(value.Value, "", false, obj); }
else
{ update(); }
}
示例6: GeneratorInfo
public GeneratorInfo(PythonAnalyzer projectState, IPythonProjectEntry entry)
: base(projectState.ClassInfos[BuiltinTypeId.Generator]) {
_declaringModule = entry;
_declaringVersion = entry.AnalysisVersion;
Yields = new VariableDef();
Sends = new VariableDef();
Returns = new VariableDef();
}
示例7: FunctionScope
public FunctionScope(FunctionInfo function, Node node, InterpreterScope declScope)
: base(function, node, declScope)
{
ReturnValue = new VariableDef();
if (Function.FunctionDefinition.IsGenerator) {
Generator = new GeneratorInfo(function.ProjectState, Function.FunctionDefinition);
ReturnValue.AddTypes(function.ProjectEntry, Generator.SelfSet, false);
}
}
示例8: SetVariable
public override void SetVariable(VariableDef variable, object obj) {
base.SetVariable(variable, obj);
if (variable != null) {
Type valueType = variable.GetValueType();
if (valueType == typeof(bool))
{ checkBox.Checked = (bool)variable.Value; }
}
}
示例9: CopyVariableDef
private static VariableDef CopyVariableDef(VariableDef original) {
LocatedVariableDef locVarDef = original as LocatedVariableDef;
if (locVarDef != null) {
return new LocatedVariableDef(
locVarDef.Entry,
locVarDef.Node
);
}
return new VariableDef();
}
示例10: CoroutineInfo
public CoroutineInfo(PythonAnalyzer projectState, IPythonProjectEntry entry)
: base(projectState.ClassInfos[BuiltinTypeId.Generator]) {
// Internally, coroutines are represented by generators with a CO_*
// flag on the code object. Here we represent it as a separate info,
// but reuse the underlying class info.
_declaringModule = entry;
_declaringVersion = entry.AnalysisVersion;
Returns = new VariableDef();
}
示例11: CreateVariable
public VariableDef CreateVariable(Node node, AnalysisUnit unit, string name, bool addRef = true)
{
var res = GetVariable(node, unit, name, addRef);
if (res == null) {
_variables[name] = res = new VariableDef();
if (addRef) {
res.AddReference(node, unit);
}
}
return res;
}
示例12: GeneratorInfo
public GeneratorInfo(FunctionInfo functionInfo)
: base(functionInfo.ProjectState._generatorType)
{
_functionInfo = functionInfo;
var nextMeth = VariableDict["next"];
var sendMeth = VariableDict["send"];
_nextMethod = new GeneratorNextBoundBuiltinMethodInfo(this, (BuiltinMethodInfo)nextMeth.First());
_sendMethod = new GeneratorSendBoundBuiltinMethodInfo(this, (BuiltinMethodInfo)sendMeth.First());
_sends = new VariableDef();
}
示例13: CartesianProductFunctionAnalysisUnit
public CartesianProductFunctionAnalysisUnit(UserFunctionValue funcInfo, EnvironmentRecord environment, AnalysisUnit outerUnit, UserFunctionValue.CallArgs callArgs, VariableDef returnValue)
: base(funcInfo, outerUnit, environment.Parent, outerUnit.ProjectEntry, environment) {
_callArgs = callArgs;
_returnValue = returnValue;
_this = new VariableDef();
var funcScope = environment as FunctionEnvironmentRecord;
var specLocals = new List<CartesianLocalVariable>();
ProcessVariablesForScope(funcScope, specLocals);
_specializedLocals = specLocals.ToArray();
}
示例14: SetVariable
public override void SetVariable(VariableDef value, object obj)
{
base.SetVariable(value, obj);
string selectionName = "";
if (value != null)
{
ParInfo par = value.Value as ParInfo;
if (par != null)
selectionName = par.Name;
}
setComboBox(selectionName);
}
示例15: FunctionScope
public FunctionScope(
FunctionInfo function,
Node node,
InterpreterScope declScope,
IPythonProjectEntry declModule
)
: base(function, node, declScope) {
ReturnValue = new VariableDef();
if (Function.FunctionDefinition.IsCoroutine) {
Coroutine = new CoroutineInfo(function.ProjectState, declModule);
ReturnValue.AddTypes(function.ProjectEntry, Coroutine.SelfSet, false);
} else if (Function.FunctionDefinition.IsGenerator) {
Generator = new GeneratorInfo(function.ProjectState, declModule);
ReturnValue.AddTypes(function.ProjectEntry, Generator.SelfSet, false);
}
}