本文整理汇总了C#中VariableType类的典型用法代码示例。如果您正苦于以下问题:C# VariableType类的具体用法?C# VariableType怎么用?C# VariableType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VariableType类属于命名空间,在下文中一共展示了VariableType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FunctionSymbol
/// <summary>
/// Constuctor for function symbol
/// </summary>
/// <param name="name"></param>
/// <param name="symbolType"></param>
/// <param name="label"></param>
/// <param name="paramList"></param>
/// <param name="returnVar"></param>
public FunctionSymbol(string name,SymbolType symbolType,string label,
List<Parameter> paramList,VariableType returnVar)
: base(name,symbolType,label,paramList)
{
this.returnVar = returnVar;
this.variableType = returnVar;
}
示例2: ParameterSymbol
/// <summary>
/// Constructor for parameter symbol
/// </summary>
/// <param name="name"></param>
/// <param name="symbolType"></param>
/// <param name="parameter"></param>
public ParameterSymbol(string name,SymbolType symbolType, Parameter parameter,
VariableType variableType)
: base(name,symbolType)
{
base.variableType = variableType;
this.parameter = parameter;
}
示例3: GVar
/**
* The main Constructor.
* An array of ID numbers is required, to ensure its own ID is unique.
*/
public GVar(int[] idArray)
{
val = 0;
floatVal = 0f;
textVal = "";
type = VariableType.Boolean;
id = 0;
link = VarLink.None;
pmVar = "";
popUps = null;
updateLinkOnStart = false;
backupVal = 0;
backupFloatVal = 0f;
// Update id based on array
foreach (int _id in idArray)
{
if (id == _id)
{
id ++;
}
}
label = "Variable " + (id + 1).ToString ();
}
示例4: Method
/// <summary>
/// Main constructor
/// </summary>
/// <param name="superBlock">Super block</param>
/// <param name="name">Method name</param>
/// <param name="returnType">Method return type</param>
/// <param name="parameters">Method parameters</param>
public Method(Block superBlock, string name, VariableType returnType, Parameter[] parameters) : base(superBlock)
{
Name = name;
ReturnType = returnType;
Parameters = parameters;
ReturnValue = null;
}
示例5: Parameter
/// <summary>
/// Constructor for a parameter
/// </summary>
/// <param name="mode"></param>
/// <param name="variableType"></param>
public Parameter(string name,IOMode mode, VariableType variableType,int size)
{
this.mode = mode;
this.variableType = variableType;
this.name = name;
this.size = size;
}
示例6: Template
public Template(string[] iden, VariableType[] layout, bool casesens, VariableType infinitism)
{
_iden=iden;
_layout=layout;
_casesens=casesens;
_infinitism=infinitism;
}
示例7: CreateVariableParameters
public static Offset<VariableParameters> CreateVariableParameters(FlatBufferBuilder builder,
VariableType type = (VariableType)0)
{
builder.StartObject(1);
VariableParameters.AddType(builder, type);
return VariableParameters.EndVariableParameters(builder);
}
示例8: LocationPreviewItem
public LocationPreviewItem(VsProjectAnalyzer analyzer, FilePreviewItem parent, AnalysisLocation locationInfo, VariableType type) {
_lineNo = locationInfo.Line;
_columnNo = locationInfo.Column;
_parent = parent;
var analysis = analyzer.GetAnalysisEntryFromPath(locationInfo.FilePath);
_type = type;
if (analysis != null) {
string text = analysis.GetLine(locationInfo.Line);
string trimmed = text.TrimStart(_whitespace);
_text = trimmed;
_span = new Span(_columnNo - (text.Length - trimmed.Length) - 1, parent.Engine.OriginalName.Length);
if (String.Compare(_text, _span.Start, parent.Engine.OriginalName, 0, parent.Engine.OriginalName.Length) != 0) {
// we are renaming a name mangled name (or we have a bug where the names aren't lining up).
Debug.Assert(_text.Substring(_span.Start, _span.Length + 1 + parent.Engine.PrivatePrefix.Length) == "_" + parent.Engine.PrivatePrefix + parent.Engine.OriginalName);
if (parent.Engine.Request.Name.StartsWith("__")) {
// if we're renaming to a private prefix name then we just rename the non-prefixed portion
_span = new Span(_span.Start + 1 + parent.Engine.PrivatePrefix.Length, _span.Length);
_columnNo += 1 + parent.Engine.PrivatePrefix.Length;
} else {
// otherwise we renmae the prefixed and non-prefixed portion
_span = new Span(_span.Start, _span.Length + 1 + parent.Engine.PrivatePrefix.Length);
}
}
} else {
_text = String.Empty;
}
}
示例9: VariableConstructorTest1
public void VariableConstructorTest1()
{
string name = string.Empty; // TODO: Initialize to an appropriate value
VariableType type = new VariableType(); // TODO: Initialize to an appropriate value
object value = null; // TODO: Initialize to an appropriate value
Variable target = new Variable(name, type, value);
Assert.Inconclusive("TODO: Implement code to verify target");
}
示例10: ParameterDefinition
public ParameterDefinition(LittleBigCParser.FormalParameterContext context)
{
_context = context;
var type = _context.variableType().simpleVariableType().GetText().ToString();
_variableType = VariableDefinition.VariableTypes[type];
}
示例11: VariableSymbol
/// <summary>
/// Constructor for Variable Symbol
/// </summary>
/// <param name="name"></param>
/// <param name="size"></param>
/// <param name="offset"></param>
public VariableSymbol( string name, SymbolType symbolType, VariableType var,int size,
int offset)
: base(name,symbolType)
{
this.size = size;
this.offset = offset;
this.variableType = var;
}
示例12: zero
private static readonly ExpressionNode DefaultIntValueExpression = ExpressionNode.CreateConstantExpression(0); //the default value for an int is zero (0).
#endregion Fields
#region Constructors
/// <summary>
/// Creates a new instance of the VariableDeclarationNode class.
/// </summary>
/// <param name="type">The type of the variable.</param>
/// <param name="name">The name of the variable.</param>
/// <param name="initialValue">A expression used to initialise the variable initially or null to use the default value.</param>
public VariableDeclarationNode(VariableType type, string name, ExpressionNode initialValue)
{
Type = type;
Name = name;
initialValue = initialValue ?? DefaultIntValueExpression;
InitialValueExpression = initialValue;
}
示例13: CreateVariable
/// <summary>
/// Creates the correct implementation of variable for the evaluation.
/// </summary>
/// <param name="variable">The oval definitions variable.</param>
/// <returns></returns>
public Evaluator CreateVariable(VariableType variable, oval_system_characteristics sytemCharacteristics, IEnumerable<VariableType> variablesOfDefinitions, oval_variables externalVariables)
{
if (variable is VariablesTypeVariableConstant_variable)
return new ConstantVariableEvaluator((VariablesTypeVariableConstant_variable)variable);
else if (variable is VariablesTypeVariableLocal_variable)
return new LocalVariableEvaluator((VariablesTypeVariableLocal_variable)variable, sytemCharacteristics, variablesOfDefinitions, externalVariables);
else if (variable is VariablesTypeVariableExternal_variable)
return new ExternalVariableEvaluator((VariablesTypeVariableExternal_variable)variable, externalVariables);
return null;
}
示例14: VerifyVariableInformation
/// <summary>
/// Verifies Variable information in Burn_Manifest.xml.
/// </summary>
/// <param name="embededResourcesDirectoryPath">Output folder where all the embeded resources are.</param>
/// <param name="variableName">Expected name of the variable.</param>
/// <param name="variableValue">Expected value of the variable.</param>
/// <param name="variableType">Expected Type of the variable.</param>
public static void VerifyVariableInformation(string embededResourcesDirectoryPath, string variableName, string variableValue, VariableType variableType)
{
string expectedVariableTypeName = GetVariableTypeName(variableType);
string burnManifestXPath = string.Format(@"//burn:Variable[@Id='{0}']", variableName);
XmlNodeList burnManifestNodes = BundleTests.QueryBurnManifest(embededResourcesDirectoryPath, burnManifestXPath);
Assert.True(1 == burnManifestNodes.Count, String.Format("No Variable with the name: '{0}' was found in Burn_Manifest.xml.", variableName));
BundleTests.VerifyAttributeValue(burnManifestNodes[0], "Value", variableValue);
BundleTests.VerifyAttributeValue(burnManifestNodes[0], "Type", expectedVariableTypeName);
}
示例15: defineType
private void defineType(string value)
{
int i = 0;
if(int.TryParse(value, out i))
this.Type = VariableType.Number;
else if(value.Equals("false") || value.Equals("true"))
this.Type = VariableType.Boolean;
else
this.Type = VariableType.String;
}