本文整理汇总了C#中ITree类的典型用法代码示例。如果您正苦于以下问题:C# ITree类的具体用法?C# ITree怎么用?C# ITree使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITree类属于命名空间,在下文中一共展示了ITree类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ConvertNode
private static Modifier ConvertNode(ITree node)
{
switch ((JavaNodeType) node.Type)
{
case JavaNodeType.PUBLIC:
return Modifier.Public;
case JavaNodeType.PROTECTED:
return Modifier.Protected;
case JavaNodeType.PRIVATE:
return Modifier.Private;
case JavaNodeType.STATIC:
return Modifier.Static;
case JavaNodeType.ABSTRACT:
return Modifier.Abstract;
case JavaNodeType.NATIVE:
return Modifier.Native;
case JavaNodeType.SYNCHRONIZED:
return Modifier.Syncronized;
case JavaNodeType.TRANSIENT:
return Modifier.Transient;
case JavaNodeType.VOLATILE:
return Modifier.Volatile;
case JavaNodeType.STRICTFP:
return Modifier.Strict;
default:
throw new NotImplementedException();
}
}
开发者ID:will14smith,项目名称:JavaCompiler,代码行数:28,代码来源:ModifierListTranslator.cs
示例2: getBranchListDisplay
public List<string> getBranchListDisplay(ITree t)
{
List<string> strList = new List<string>();
int count = 1;
foreach (var tb in branchList)
{
var branchInclude = true;
//check conditions on branch
if (tb.conditionList != null)
{
foreach (var cond in tb.conditionList)
{
if (!t.globalFlags.checkFlag(cond.flagName, cond.value, cond.flagCompareType))
{
branchInclude = false;
}
}
}
if (branchInclude)
{
strList.Add(string.Format("-->{0}. {1}", count, tb.ToString()));
count++;
}
}
return strList;
}
开发者ID:mengtest,项目名称:UnityRPG,代码行数:28,代码来源:TreeNode.cs
示例3: BuildStylesheet
private static Stylesheet BuildStylesheet(ITree tree)
{
var stylesheet = new Stylesheet();
stylesheet.Build(tree);
return stylesheet;
}
开发者ID:RussPAll,项目名称:ExCSS,代码行数:7,代码来源:StylesheetParser.cs
示例4: fsTypeInferer
public fsTypeInferer(ITree tree, string outFileName)
{
this.tree = tree;
functionsInfos = new Dictionary<string, fsDerFuncInfo>();
varDerFuncTable = new Dictionary<string, fsDerFuncInfo>();
enteredFunctionsNames = new List<string>();
enteredFunctionsNames.Add(outFileName);
inferenceFunctions = new Dictionary<int, InferNodeTypeDelegate>();
inferenceFunctions.Add(fsharp_ssParser.PROGRAM, InferProgramType);
inferenceFunctions.Add(fsharp_ssParser.PLUS, InferPlusType);
inferenceFunctions.Add(fsharp_ssParser.MINUS, InferMinusType);
inferenceFunctions.Add(fsharp_ssParser.MULT, InferMultType);
inferenceFunctions.Add(fsharp_ssParser.DIV, InferDivideType);
inferenceFunctions.Add(fsharp_ssParser.EQ, InferEqNeqOperType);
inferenceFunctions.Add(fsharp_ssParser.NEQ, InferEqNeqOperType);
inferenceFunctions.Add(fsharp_ssParser.GT, InferCompareOperType);
inferenceFunctions.Add(fsharp_ssParser.GE, InferCompareOperType);
inferenceFunctions.Add(fsharp_ssParser.LT, InferCompareOperType);
inferenceFunctions.Add(fsharp_ssParser.LE, InferCompareOperType);
inferenceFunctions.Add(fsharp_ssParser.ID, InferIDType);
inferenceFunctions.Add(fsharp_ssParser.INT, InferIntType);
inferenceFunctions.Add(fsharp_ssParser.DOUBLE, InferDoubleType);
inferenceFunctions.Add(fsharp_ssParser.CHAR, InferCharType);
inferenceFunctions.Add(fsharp_ssParser.TRUE, InferBoolType);
inferenceFunctions.Add(fsharp_ssParser.FALSE, InferBoolType);
inferenceFunctions.Add(fsharp_ssParser.STRING, InferStringType);
inferenceFunctions.Add(fsharp_ssParser.BODY, InferBodyType);
inferenceFunctions.Add(fsharp_ssParser.IF, InferIfClauseType);
inferenceFunctions.Add(fsharp_ssParser.ELIF, InferElifClauseType);
inferenceFunctions.Add(fsharp_ssParser.FUNCTION_DEFN, InferFunctionDefnType);
inferenceFunctions.Add(fsharp_ssParser.FUNCTION_CALL, InferFuncCallType);
inferenceFunctions.Add(fsharp_ssParser.VALUE_DEFN, InferValueDefnType);
}
开发者ID:taqtaq11,项目名称:fSharpJVML,代码行数:34,代码来源:fsTypeInferer.cs
示例5: LiteralExpression
public LiteralExpression(ITree tree)
{
for(int i = 0; i<tree.ChildCount;i++)
{
value += tree.GetChild(i).Text;
}
}
开发者ID:erikvanbrakel,项目名称:less.net,代码行数:7,代码来源:StyleExpression.cs
示例6: GetCommandForOperator
/// <summary>
/// Gets the command for the function called in the specified source tree.
/// </summary>
/// <param name="source">The source Antlr tree representing a function call..</param>
/// <returns>The parsed AstFunctionNode.</returns>
/// <exception cref="NoViableAltException"><c>NoViableAltException</c>.</exception>
private static PostfixMathCommand GetCommandForOperator( ITree source )
{
PostfixMathCommand command;
switch ( source.Type )
{
case TokenTypes.OP_ADD:
command = new Add();
break;
case TokenTypes.OP_SUBTRACT:
command = new Subtract();
break;
case TokenTypes.OP_MULTIPLY:
command = new Multiply();
break;
case TokenTypes.OP_DIVIDE:
command = new Divide();
break;
default:
throw new NoViableAltException();
}
return command;
}
开发者ID:ChrisEdwards,项目名称:CalcEngine,代码行数:32,代码来源:CalcEngineTreeParser.cs
示例7: MathExprIntepreter
public MathExprIntepreter(ITree programNode)
{
if (programNode.Type != AstNodeType.PROGRAM)
throw new IntepreterException("AST-дерево не является программой");
this.programNode = programNode;
}
开发者ID:tony-karandeev,项目名称:SimpleC,代码行数:7,代码来源:MathExprIntepreter.cs
示例8: Execute
public void Execute(ITree node)
{
switch (node.Type)
{
case cLexer.ASSIGN:
Assign(node);
break;
case cLexer.VAR_DEC:
VarsDeclaration(node);
break;
// todo funccall
// todo read
// todo write
// todo func_declaration
// todo return
case cLexer.BLOCK:
Block(node);
break;
case cLexer.IF:
If(node);
break;
// todo for_construction
default:
throw new Exception("Non executable node.");
}
}
开发者ID:greenflame,项目名称:vsu_compiler,代码行数:35,代码来源:Interpreter.cs
示例9: Parse
public static Statement Parse(ITree tree)
{
if (tree.Text == "FUNCCALL")
{
Expression exp = tree.ParseExpr();
return new ExprStatement(exp);
}
else if (tree.Text == "IF")
{
Expression cond = tree.GetChild("IF_CONDITION").GetOnlyChild().ParseExpr();
ITree actionTree = tree.GetChild("IF_ACTION");
Statement action = actionTree.ParseStmtList();
return new IfStatement(cond, action);
}
else if (tree.Text == "ASSIGNMENT")
{
Expression variable = tree.GetChild(0).ParseExpr();
Expression value = tree.GetChild(1).ParseExpr();
Statement assignment = new AssignmentStatement(variable, value);
return assignment;
}
else if (tree.Text == "Return")
{
Expression exp = tree.GetOnlyChild().ParseExpr();
return new ReturnStatement(exp);
}
else
{
throw new InvalidGameException(tree.FileCoords() + " - Ivalid statement: " + tree.Text);
}
}
开发者ID:hgabor,项目名称:boardgame,代码行数:31,代码来源:Statement.cs
示例10: Assign
public void Assign(ITree node)
{
string var_name = node.GetChild(0).ToString();
ITree node_to_solve = node.GetChild(1);
_varStorage[var_name].Assign(Solve(node_to_solve));
}
开发者ID:greenflame,项目名称:vsu_compiler,代码行数:7,代码来源:Interpreter.cs
示例11: Block
public void Block(ITree node)
{
for (int i = 0; i < node.ChildCount; i++)
{
Execute(node.GetChild(i));
}
}
开发者ID:greenflame,项目名称:vsu_compiler,代码行数:7,代码来源:Interpreter.cs
示例12: SimTreeGridItemEventArgs
//-------------------------------------------------------------------------------------
/// <summary>
/// Инициализирующий конструктор.
/// </summary>
/// <param name="hasChildren">Определяет, имеются ли дочерние элементы.</param>
/// <param name="item">Элемент дерева, для которого определяется наличие дочерних элементов.</param>
/// <param name="tree">Дерево</param>
public SimTreeGridItemEventArgs(ITree tree, ITreeItem item, bool hasChildren)
: this()
{
Item = item;
HasChildren = hasChildren;
Tree = tree;
}
开发者ID:GoldMax,项目名称:Pulsar.NET,代码行数:14,代码来源:SimTreeGridView.cs
示例13: InternalToTransferCodeBase
protected override IRequest InternalToTransferCodeBase(IPuzzlePiece root, ITree<IPuzzlePiece> matchtree, Dictionary<string, object> bindings)
{
ILocation loca = TilingUtils.MatchLocation (matchtree.ChildAt(0x00).ChildAt(0x00).Data);
ILocation locb = TilingUtils.MatchLocation (matchtree.ChildAt(0x00).ChildAt(0x01).Data);
DateTime dt = bindings.ValueOrDefault<string,object,DateTime>("time");
string als = bindings.ValueOrDefault<string,object,string>("airlinecode");
string scs = bindings.ValueOrDefault<string,object,string>("classname");
Airline al = null;
SeatClass sc = null;
if(als != null) {
al = new Airline (als);
}
if(scs != null) {
sc = new SeatClass (scs);
}
if (loca is Country && locb is Country) {
return new RequestGetFlights ((Country)loca, (Country)locb, dt, al, sc);
} else if (loca is City && locb is City) {
return new RequestGetFlights ((City)loca, (City)locb, dt, al, sc);
} else if (loca is Airport && locb is Airport) {
return new RequestGetFlights ((Airport)loca, (Airport)locb, dt, al, sc);
} else {
return null;
}
}
开发者ID:KommuSoft,项目名称:CplKul2012,代码行数:25,代码来源:RequestGetFlightsTilePattern.cs
示例14: Validate
public List<string> Validate(ITree tree)
{
_errors = new List<string>();
CreateFilterInner();
InnerValidate(tree.Root);
return _errors;
}
开发者ID:nmenshov,项目名称:Iron-C--,代码行数:7,代码来源:ValidatorFilter.cs
示例15: CreateFromAntlrAst
//^(SEQUENCE_OF_TYPE (SIMPLIFIED_SIZE_CONSTRAINT $sz)? $gen? identifier? type)
public static new SequenceOfType CreateFromAntlrAst(ITree tree)
{
SequenceOfType ret = DefaultBackend.Instance.Factory.CreateSequenceOfType();
for (int i = 0; i < tree.ChildCount; i++)
{
ITree child = tree.GetChild(i);
switch (child.Type)
{
case asn1Parser.SIMPLIFIED_SIZE_CONSTRAINT:
case asn1Parser.CONSTRAINT:
ret.m_AntlrConstraints.Add(child);
break;
case asn1Parser.LID:
ret.m_xmlVarName = child.Text;
break;
case asn1Parser.TYPE_DEF:
ret.m_type = Asn1Type.CreateFromAntlrAst(child);
break;
default:
throw new Exception("Unkown child: " + child.Text + " for node: " + tree.Text);
}
}
return ret;
}
开发者ID:kia92798,项目名称:tinyasn1,代码行数:26,代码来源:SequenceOf.cs
示例16: TreeObject
/// <summary>
/// Initializes a new instance of the <see cref="TreeObject"/> class.
/// </summary>
/// <param name="name">
/// The name.
/// </param>
/// <param name="type">
/// The type.
/// </param>
/// <param name="numericTree">
/// The numeric tree.
/// </param>
public TreeObject(string name, string type, ITree<double> numericTree)
{
this.Name = name;
this.Type = type;
this.TextTree = null;
this.NumericTree = numericTree;
}
开发者ID:rosaskc,项目名称:gptrees,代码行数:19,代码来源:TreeObject.cs
示例17: WalkInit
private static MethodTree WalkInit(ITree initNode)
{
Debug.Assert(initNode.Type == (int)JavaNodeType.FOR_INIT);
if (initNode.ChildCount == 0)
{
return null;
}
var child = initNode.GetChild(0);
var exprs = new MethodTree();
if (child.Type == (int)JavaNodeType.VAR_DECLARATION)
{
new VarDeclarationTranslator(child).Walk().ForEach(exprs.Add);
}
else
{
for (var i = 0; i < initNode.ChildCount; i++)
{
exprs.Add(new ExpressionTranslator(initNode.GetChild(i)).Walk());
}
}
return exprs;
}
开发者ID:will14smith,项目名称:JavaCompiler,代码行数:27,代码来源:ForTranslator.cs
示例18: CreateFromAntlrAst
public static new SetType CreateFromAntlrAst(ITree tree)
{
SetType ret = DefaultBackend.Instance.Factory.CreateSetType();
if (tree.ChildCount>0)
SequenceOrSetType.CreateFromAntlrAst(ret, tree.GetChild(0));
return ret;
}
开发者ID:kia92798,项目名称:tinyasn1,代码行数:7,代码来源:Set.cs
示例19: MSILGenerator
public MSILGenerator(ITree programNode)
{
if (programNode.Type != AstNodeType.PROGRAM)
throw new MSILGeneratorException("AST-дерево не является программой");
this.programNode = programNode;
}
开发者ID:anatoliy-sh,项目名称:Swift_compiler,代码行数:7,代码来源:MSILGenerator.cs
示例20: Create
internal static QueryParseException Create(ITree parserNode,
string message,
string parsedString,
Exception innerException,
QueryParseErrorReason? errorReason = null,
string memberName = null)
{
if (parserNode != null && parsedString != null)
{
var sb = new StringBuilder();
sb.AppendLine(message);
var commonErrorNode = parserNode as CommonErrorNode;
var line = parserNode.Line;
var charPositionInLine = parserNode.CharPositionInLine;
if (commonErrorNode != null)
{
line = commonErrorNode.trappedException.Line;
charPositionInLine = commonErrorNode.trappedException.CharPositionInLine;
sb.AppendFormat("({0})\r\n", commonErrorNode.trappedException.Message);
}
sb.AppendFormat("Error on line {0} character {1} of query:\r\n",
line,
charPositionInLine);
sb.Append(' ', charPositionInLine);
sb.AppendLine("|/");
sb.AppendLine(GetLineOfString(parsedString, line));
message = sb.ToString();
}
return new QueryParseException(message,
innerException,
errorReason ?? QueryParseErrorReason.GenericError,
memberName);
}
开发者ID:Pomona,项目名称:Pomona,代码行数:35,代码来源:QueryParseException.cs
注:本文中的ITree类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论