本文整理汇总了C#中VariableName类的典型用法代码示例。如果您正苦于以下问题:C# VariableName类的具体用法?C# VariableName怎么用?C# VariableName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VariableName类属于命名空间,在下文中一共展示了VariableName类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GotoStmt
public GotoStmt(Text.Span span, string/*!*/labelName, Text.Span nameSpan)
: base(span)
{
Debug.Assert(!string.IsNullOrEmpty(labelName));
_labelName = new VariableName(labelName);
_nameSpan = nameSpan;
}
开发者ID:dw4dev,项目名称:Phalanger,代码行数:7,代码来源:JumpStmt.cs
示例2: Parse
public override bool Parse(IItemFactory itemFactory, ITextProvider text, ITokenStream stream)
{
var name = new VariableName(SassClassifierType.VariableReference);
if (name.Parse(itemFactory, text, stream))
{
Name = name;
Children.Add(name);
}
return Children.Count > 0;
}
开发者ID:profet23,项目名称:SassyStudio,代码行数:11,代码来源:VariableReference.cs
示例3: FormalParam
public FormalParam(Position position, string/*!*/ name, object typeHint, bool passedByRef,
Expression initValue, List<CustomAttribute> attributes)
: base(position)
{
this.name = new VariableName(name);
this.typeHint = typeHint;
this.passedByRef = passedByRef;
this.initValue = initValue;
this.attributes = new CustomAttributes(attributes);
this.resolvedTypeHint = null;
}
开发者ID:hansdude,项目名称:Phalanger,代码行数:12,代码来源:FunctionDecl.cs
示例4: FormalParam
public FormalParam(Text.Span span, string/*!*/ name, object typeHint, bool passedByRef,
Expression initValue, List<CustomAttribute> attributes)
: base(span)
{
Debug.Assert(typeHint == null || typeHint is PrimitiveTypeName || typeHint is GenericQualifiedName);
this.name = new VariableName(name);
this.typeHint = typeHint;
this.passedByRef = passedByRef;
this.initValue = initValue;
if (attributes != null && attributes.Count != 0)
this.Attributes = new CustomAttributes(attributes);
this.TypeHintPosition = Text.Span.Invalid;
}
开发者ID:kaviarasankk,项目名称:Phalanger,代码行数:15,代码来源:FunctionDecl.cs
示例5: CreateVariable
BoundVariable CreateVariable(VariableName name, VariableKind kind, Func<BoundExpression> initializer)
{
switch (kind)
{
case VariableKind.LocalVariable:
Debug.Assert(initializer == null);
return new BoundLocal(new SourceLocalSymbol(_routine, name.Value, kind));
case VariableKind.StaticVariable:
return new BoundStaticLocal(new SourceLocalSymbol(_routine, name.Value, kind), initializer?.Invoke());
case VariableKind.GlobalVariable:
Debug.Assert(initializer == null);
return new BoundGlobalVariable(name);
default:
Debug.Assert(initializer == null);
throw Roslyn.Utilities.ExceptionUtilities.UnexpectedValue(kind);
}
}
开发者ID:iolevel,项目名称:peachpie,代码行数:20,代码来源:LocalsTable.cs
示例6: Parse
public override bool Parse(IItemFactory itemFactory, ITextProvider text, ITokenStream stream)
{
var name = new VariableName(SassClassifierType.VariableDefinition);
if (name.Parse(itemFactory, text, stream))
{
Name = name;
Children.Add(name);
}
if (stream.Current.Type == TokenType.Colon)
Colon = Children.AddCurrentAndAdvance(stream);
while (!IsValueTerminator(Mode, stream))
{
ParseItem item;
if (itemFactory.TryCreateParsedOrDefault(this, text, stream, out item))
{
Values.Add(item);
Children.Add(item);
}
}
if (stream.Current.Type == TokenType.Bang)
{
var modifier = new DefaultModifier();
if (modifier.Parse(itemFactory, text, stream))
{
Modifier = modifier;
Children.Add(modifier);
}
else
{
Children.AddCurrentAndAdvance(stream);
}
}
if (stream.Current.Type == TokenType.Semicolon)
Semicolon = Children.AddCurrentAndAdvance(stream);
return Children.Count > 0;
}
开发者ID:profet23,项目名称:SassyStudio,代码行数:41,代码来源:VariableDefinition.cs
示例7: ConstantDecl
public ConstantDecl(Text.Span span, string/*!*/ name, Expression/*!*/ initializer)
: base(span)
{
this.name = new VariableName(name);
this.initializer = initializer;
}
开发者ID:dw4dev,项目名称:Phalanger,代码行数:6,代码来源:Expression.cs
示例8: NotifyListeners
/// <summary>
/// Notify all listeners that a variable in the model has been changed.
/// </summary>
private void NotifyListeners(VariableName v, object oldValue, object newValue)
{
lock(this)
{
lock(listeners)
{
foreach (IEditorListener l in listeners)
{
l.ModelChanged(v, oldValue, newValue);
}
}
}
}
开发者ID:hallgeirl,项目名称:Hiage,代码行数:16,代码来源:EditorModel.cs
示例9: PhpField
/// <summary>
/// Used by full reflection.
/// </summary>
public PhpField(VariableName name, DPropertyDesc/*!*/ fieldDesc, FieldInfo/*!*/ fieldInfo,
PropertyInfo exportedProperty)
: base(fieldDesc, name)
{
Debug.Assert(fieldDesc is DPhpFieldDesc);
this.realField = fieldInfo;
this.exportedProperty = exportedProperty;
this.hasInitialValue = realField.IsDefined(typeof(PhpHasInitValueAttribute), false);
this.builder = null;
this.implementor = DeclaringPhpType;
}
开发者ID:tiaohai,项目名称:Phalanger,代码行数:16,代码来源:Properties.cs
示例10: KnownProperty
/// <summary>
/// Used by subclasses.
/// </summary>
protected KnownProperty(DPropertyDesc/*!*/ propertyDesc, VariableName name)
: base(propertyDesc)
{
this.name = name;
// TODO
}
开发者ID:tiaohai,项目名称:Phalanger,代码行数:10,代码来源:Properties.cs
示例11: ClrField
/// <summary>
/// Used by full-reflect.
/// </summary>
public ClrField(VariableName/*!*/ name, ClrTypeDesc/*!*/ declaringType, PhpMemberAttributes memberAttributes,
FieldInfo/*!*/ fieldInfo)
: base(new DPropertyDesc(declaringType, memberAttributes), name)
{
this.fieldInfo = fieldInfo;
}
开发者ID:tiaohai,项目名称:Phalanger,代码行数:9,代码来源:Properties.cs
示例12: EmitEnsureStaticProperty
/// <summary>
/// Emits IL instructions that ensure that a static field is of <see cref="PhpObject"/> or <see cref="PhpArray"/>
/// type. Handles the case when field name is known at compile time (see <see cref="AST.DirectStFldUse"/>).
/// </summary>
/// <param name="property">The corresponding <see cref="DProperty"/> or <B>null</B>.</param>
/// <param name="typeRef">The class type reference (identifier index).</param>
/// <param name="fieldName">The field name (identifier index).</param>
/// <param name="ensureArray">Whether to ensure that static field is an array (or an object).</param>
/// <remarks>
/// Nothing is expected on the evaluation stack. A <see cref="PhpObject"/> or <see cref="DObject"/> is left
/// on the evaluation stack or the last emitted instruction is unconditional branch to <see cref="Chain.ErrorLabel"/>.
/// </remarks>
public PhpTypeCode EmitEnsureStaticProperty(DProperty property, TypeRef typeRef,
VariableName fieldName, bool ensureArray)
{
ILEmitter il = codeGenerator.IL;
PhpField php_field = property as PhpField;
if (php_field != null)
{
// HACK HACK
EmitEnsureStaticPhpFieldDirect(php_field, ensureArray);
EmitErrorCheck(ensureArray);
return (ensureArray) ? PhpTypeCode.PhpArray : PhpTypeCode.DObject;
}
else return EmitEnsureStaticProperty(typeRef, fieldName, null, ensureArray);
}
开发者ID:dw4dev,项目名称:Phalanger,代码行数:28,代码来源:Chains.cs
示例13: NamedActualParam
public NamedActualParam(Position position, string name, Expression/*!*/ expression)
: base(position)
{
this.name = new VariableName(name);
this.expression = expression;
}
开发者ID:Ashod,项目名称:Phalanger,代码行数:6,代码来源:CallSignature.cs
示例14: ResolveClassConstantName
internal DConstant ResolveClassConstantName(DType/*!*/ type, VariableName constantName,
Position position, PhpType referringType, PhpRoutine referringRoutine, out bool checkVisibilityAtRuntime)
{
checkVisibilityAtRuntime = false;
// we cannot resolve a class constant unless we know the inherited members:
if (type.IsDefinite)
{
ClassConstant constant;
GetMemberResult member_result = type.GetConstant(constantName, referringType, out constant);
switch (member_result)
{
case GetMemberResult.OK:
return constant;
case GetMemberResult.NotFound:
ErrorSink.Add(Errors.UnknownClassConstantAccessed, SourceUnit, position, type.FullName, constantName);
return new UnknownClassConstant(type, constantName.Value);
case GetMemberResult.BadVisibility:
if (referringType == null && referringRoutine == null)
{
// visibility must be checked at run-time:
checkVisibilityAtRuntime = true;
return constant;
}
else
{
// definitive error:
if (constant.IsPrivate)
{
ErrorSink.Add(Errors.PrivateConstantAccessed, SourceUnit, position, type.FullName, constantName.Value,
referringType.FullName);
}
else
{
ErrorSink.Add(Errors.ProtectedConstantAccessed, SourceUnit, position, type.FullName, constantName.Value,
referringType.FullName);
}
return new UnknownClassConstant(type, constantName.Value);
}
default:
Debug.Fail();
throw null;
}
}
else
{
// warning (if any) reported by the type resolver:
return new UnknownClassConstant(type, constantName.Value);
}
}
开发者ID:Ashod,项目名称:Phalanger,代码行数:55,代码来源:Analyzer.cs
示例15: ClrPropertyBase
/// <summary>
/// Used by full-reflect.
/// </summary>
public ClrPropertyBase(DPropertyDesc/*!*/ propertyDesc, VariableName name)
: base(propertyDesc, name)
{
}
开发者ID:tiaohai,项目名称:Phalanger,代码行数:7,代码来源:Properties.cs
示例16: ClrProperty
/// <summary>
/// Used by full-reflect.
/// </summary>
public ClrProperty(VariableName name, ClrTypeDesc/*!*/ declaringType, PhpMemberAttributes memberAttributes,
PropertyInfo/*!*/ realProperty, bool hasGetter, bool hasSetter)
: base(new DPropertyDesc(declaringType, memberAttributes), name)
{
Debug.Assert(realProperty != null);
this.realProperty = realProperty;
this.hasGetter = hasGetter;
this.hasSetter = hasSetter;
}
开发者ID:tiaohai,项目名称:Phalanger,代码行数:13,代码来源:Properties.cs
示例17: VariableIsAutoGlobal
internal bool VariableIsAutoGlobal(VariableName name)
{
if (!currentVariablesTable.Contains(name))
{
if (name.IsAutoGlobal)
{
return true;
}
Debug.Fail("DirectVarUse not in table and not auto-global!");
}
return false;
}
开发者ID:dw4dev,项目名称:Phalanger,代码行数:12,代码来源:CodeGenerator.cs
示例18: ClrEvent
/// <summary>
/// Used by full-reflect.
/// </summary>
public ClrEvent(VariableName name, ClrTypeDesc/*!*/ declaringType, PhpMemberAttributes memberAttributes,
EventInfo/*!*/ realEvent, bool hasAddMethod, bool hasRemoveMethod)
: base(new DPropertyDesc(declaringType, memberAttributes), name)
{
this.realEvent = realEvent;
this.hasAddMethod = hasAddMethod;
this.hasRemoveMethod = hasRemoveMethod;
}
开发者ID:tiaohai,项目名称:Phalanger,代码行数:11,代码来源:Properties.cs
示例19: EmitAutoGlobalOperation
/// <summary>
/// Emits an operation on auto-global variable with a specified name.
/// </summary>
/// <param name="name">The name of the auto-global variable.</param>
/// <param name="opCode">The operation.</param>
private void EmitAutoGlobalOperation(VariableName name, OpCode opCode)
{
FieldInfo fld = AutoGlobals.GetFieldForVariable(name);
if (fld != null)
il.Emit(opCode, fld);
else
Debug.Fail("Unsupported auto-global variable.");
}
开发者ID:dw4dev,项目名称:Phalanger,代码行数:13,代码来源:CodeGenerator.cs
示例20: EmitAutoGlobalLoadAddress
internal void EmitAutoGlobalLoadAddress(VariableName variableName)
{
EmitLoadAutoGlobals();
EmitAutoGlobalOperation(variableName, AutoGlobalLoadOpCode);
il.Emit(OpCodes.Ldflda, Fields.PhpReference_Value);
}
开发者ID:dw4dev,项目名称:Phalanger,代码行数:6,代码来源:CodeGenerator.cs
注:本文中的VariableName类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论