本文整理汇总了C#中Identifier类的典型用法代码示例。如果您正苦于以下问题:C# Identifier类的具体用法?C# Identifier怎么用?C# Identifier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Identifier类属于命名空间,在下文中一共展示了Identifier类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: findAssignment
public HashSet<Assign> findAssignment(Identifier i, HashSet<Statement> visitedNodes)
{
HashSet<Assign> assignStatements = new HashSet<Assign>();
if (this is Assign && ((Assign)this).identifier.declaration == i.declaration)
{
assignStatements.Add((Assign)this);
return assignStatements;
}
else if (this.cfgPredecessors.Count > 0)
{
foreach (Statement predecessor in this.cfgPredecessors)
{
if (!(visitedNodes.Contains(predecessor)))
{
visitedNodes.Add(predecessor);
assignStatements.UnionWith(predecessor.findAssignment(i, visitedNodes));
}
}
return assignStatements;
}
else
{
throw new AccessException(i.row, i.col, "This value has not been initialised.");
}
}
示例2: DocumentedProperty
public DocumentedProperty(Identifier name, XmlNode xml, PropertyInfo property, Type targetType)
{
Property = property;
Xml = xml;
Name = name;
TargetType = targetType;
}
示例3: ExceptHandler
public ExceptHandler(Exp type, Identifier name, SuiteStatement body, string filename, int start, int end)
: base(filename, start, end)
{
this.type = type;
this.name = name;
this.body = body;
}
示例4: Control
public Control(ISensor sensor, ISettings settings, float minSoftwareValue,
float maxSoftwareValue)
{
this.identifier = new Identifier(sensor.Identifier, "control");
this.settings = settings;
this.minSoftwareValue = minSoftwareValue;
this.maxSoftwareValue = maxSoftwareValue;
if (!float.TryParse(settings.GetValue(
new Identifier(identifier, "value").ToString(), "0"),
NumberStyles.Float, CultureInfo.InvariantCulture,
out this.softwareValue))
{
this.softwareValue = 0;
}
int mode;
if (!int.TryParse(settings.GetValue(
new Identifier(identifier, "mode").ToString(),
((int)ControlMode.Default).ToString(CultureInfo.InvariantCulture)),
NumberStyles.Integer, CultureInfo.InvariantCulture,
out mode))
{
this.mode = ControlMode.Default;
} else {
this.mode = (ControlMode)mode;
}
}
示例5: FunctionInvocationExpression
public FunctionInvocationExpression(Identifier identifier, ExpressionNode[] arguments, bool hasStarModifier)
: this()
{
_name = identifier;
_arguments = arguments;
_hasAsteriskModifier = hasStarModifier;
}
示例6: RelshipNavigationExpr
/// <summary>
/// Initializes relationship navigation expression.
/// </summary>
internal RelshipNavigationExpr(Node refExpr, Node relshipTypeName, Identifier toEndIdentifier, Identifier fromEndIdentifier)
{
_refExpr = refExpr;
_relshipTypeName = relshipTypeName;
_toEndIdentifier = toEndIdentifier;
_fromEndIdentifier = fromEndIdentifier;
}
示例7: Hardware
public Hardware(string name, Identifier identifier, ISettings settings) {
this.settings = settings;
this.identifier = identifier;
this.name = name;
this.customName = settings.GetValue(
new Identifier(Identifier, "name").ToString(), name);
}
示例8: Def
private Instruction Def(Identifier id, Expression src)
{
if (IsLocal(id))
return new Store(new MemoryAccess(MemoryIdentifier.GlobalMemory, EffectiveAddress(id), id.DataType), src);
else
return new Assignment(id, src);
}
示例9: MethodParameterInfoContext
public MethodParameterInfoContext(SourceLocation sourceLocation, int parameterIndex, Scope scope, Type expressionType, Identifier methodName)
: base(sourceLocation, parameterIndex)
{
_scope = scope;
_expressionType = expressionType;
_methodName = methodName;
}
示例10: PersonA
public PersonA(Identifier<int> id, string name, int age, int version)
{
_id = id;
_name = name;
_age = age;
_version = version;
}
示例11: Setup
public void Setup()
{
mr = new MockRepository();
program = new Program();
proc = new Procedure("testProc", new Frame(PrimitiveType.Word32));
block = proc.AddBlock("l00100000");
trace = new RtlTrace(0x00100000);
r0 = new Identifier("r0", PrimitiveType.Word32, new RegisterStorage("r0", 0, 0, PrimitiveType.Word32));
r1 = new Identifier("r1", PrimitiveType.Word32, new RegisterStorage("r1", 1, 0, PrimitiveType.Word32));
r2 = new Identifier("r2", PrimitiveType.Word32, new RegisterStorage("r2", 2, 0, PrimitiveType.Word32));
sp = new Identifier("sp", PrimitiveType.Word32, new RegisterStorage("sp", 15, 0, PrimitiveType.Word32));
grf = proc.Frame.EnsureFlagGroup(Registers.eflags, 3, "SCZ", PrimitiveType.Byte);
var sc = new ServiceContainer();
var listener = mr.Stub<DecompilerEventListener>();
scanner = mr.StrictMock<IScanner>();
arch = mr.Stub<IProcessorArchitecture>();
program.Architecture = arch;
program.SegmentMap = new SegmentMap(
Address.Ptr32(0x00100000),
new ImageSegment(
".text",
new MemoryArea(Address.Ptr32(0x00100000), new byte[0x20000]),
AccessMode.ReadExecute));
arch.Replay();
program.Platform = new DefaultPlatform(null, arch);
arch.BackToRecord();
arch.Stub(s => s.StackRegister).Return((RegisterStorage)sp.Storage);
arch.Stub(s => s.PointerType).Return(PrimitiveType.Pointer32);
scanner.Stub(s => s.Services).Return(sc);
sc.AddService<DecompilerEventListener>(listener);
}
示例12: LabelStatement
public LabelStatement(Identifier Label, Statement Labeled, TextSpan Location, TextPoint Colon)
:base(Operation.Label,Location)
{
this.Label = Label;
this.Labeled = Labeled;
this.Colon = Colon;
}
示例13: Match
public bool Match(BinaryExpression exp)
{
if (exp.Operator != Operator.IAdd)
return false;
id = exp.Left as Identifier;
bin = exp.Right as BinaryExpression;
if ((id == null || bin == null) && exp.Operator == Operator.IAdd)
{
id = exp.Right as Identifier;
bin = exp.Left as BinaryExpression;
}
if (id == null || bin == null)
return false;
if (bin.Operator != Operator.SMul && bin.Operator != Operator.UMul && bin.Operator != Operator.IMul)
return false;
Identifier idInner = bin.Left as Identifier;
cInner = bin.Right as Constant;
if (idInner == null ||cInner == null)
return false;
if (idInner != id)
return false;
return true;
}
示例14: Eval
/// <summary>
/// Returns the value that matches the hash key given as the first given parameter.
/// </summary>
public override L20nObject Eval(LocaleContext ctx, params L20nObject[] argv)
{
if (m_Items.Count == 0 || argv.Length < 1)
{
return null;
}
var first = argv [0].Eval(ctx);
Identifier id = first as Identifier;
if (id == null)
{
var str = first as StringOutput;
if (str == null)
{
Logger.Warning("Attributes: first variadic argument couldn't be evaluated as an <Identifier>");
return id;
}
id = new Identifier(str.Value);
}
L20nObject obj;
if (!m_Items.TryGetValue(id.Value, out obj))
{
Logger.WarningFormat("{0} is not a valid <identifier>", id.Value);
return null;
}
return obj;
}
示例15: CheckName
void CheckName(TypeDeclaration node, AffectedEntity entity, Identifier identifier, Modifiers accessibilty)
{
TypeResolveResult resolveResult = ctx.Resolve(node) as TypeResolveResult;
if (resolveResult == null)
return;
var type = resolveResult.Type;
if (type.DirectBaseTypes.Any(t => t.FullName == "System.Attribute")) {
if (CheckNamedResolveResult(resolveResult, node, AffectedEntity.CustomAttributes, identifier, accessibilty)) {
return;
}
} else if (type.DirectBaseTypes.Any(t => t.FullName == "System.EventArgs")) {
if (CheckNamedResolveResult(resolveResult, node, AffectedEntity.CustomEventArgs, identifier, accessibilty)) {
return;
}
} else if (type.DirectBaseTypes.Any(t => t.FullName == "System.Exception")) {
if (CheckNamedResolveResult(resolveResult, node, AffectedEntity.CustomExceptions, identifier, accessibilty)) {
return;
}
}
var typeDef = type.GetDefinition();
if (typeDef != null && typeDef.Attributes.Any(attr => attr.AttributeType.FullName == "NUnit.Framework.TestFixtureAttribute")) {
if (CheckNamedResolveResult(resolveResult, node, AffectedEntity.TestType, identifier, accessibilty)) {
return;
}
}
CheckNamedResolveResult(resolveResult, node, entity, identifier, accessibilty);
}