本文整理汇总了C#中CSsemi类的典型用法代码示例。如果您正苦于以下问题:C# CSsemi类的具体用法?C# CSsemi怎么用?C# CSsemi使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CSsemi类属于命名空间,在下文中一共展示了CSsemi类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: parse
public void parse(CSsemi.CSemiExp semi)
{
foreach (IRule rule in Rules)
{
if (rule.test(semi))
break;
}
if(rule.test(semi)!=0)
Add(rule);
}
示例2: parse
public void parse(CSsemi.CSemiExp semi)
{
// Note: rule returns true to tell parser to stop
// processing the current semiExp
foreach (IRule rule in Rules)
{
//semi.display();
if (rule.test(semi))
break;
}
}
示例3: parse
public void parse(CSsemi.CSemiExp semi, string file) //file is passed as a parameter to insert the records filewise
{
// Note: rule returns true to tell parser to stop
// processing the current semiExp
foreach (IRule rule in Rules)
{
//semi.display();
if (rule.test(semi, file)) //file is passed as a parameter to insert the records filewise
break;
}
}
示例4: doAction
public override void doAction(CSsemi.CSemiExp semi)
{
TypeModel tm = new TypeModel();
FileModel fm = new FileModel();
// Console.Write("\n Entering scope: ");
if (semi.Contains("class") != -1)
{
int index = semi.Contains("class");
// Console.Write("class: ");
tm.addType(semi[index + 1], fm.CurrentFile);
}
else if (semi.Contains("struct") != -1)
{
int index = semi.Contains("struct");
//Console.Write("struct: ");
tm.addType(semi[index + 1], fm.CurrentFile);
}
else if (semi.Contains("interface") != -1)
{
int index = semi.Contains("class");
//Console.Write("interface: ");
tm.addType(semi[index + 1], fm.CurrentFile);
}
else if (semi.Contains("enum") != -1)
{
int index = semi.Contains("class");
//Console.Write("enum: ");
tm.addType(semi[index + 1], fm.CurrentFile);
}
else if (semi.Contains("delegte") != -1)
{
int index = semi.Contains("delegate");
//Console.Write("delegate: ");
tm.addType(semi[index + 2], fm.CurrentFile);
}
else
Console.Write("");
}
示例5: doAction
public override void doAction(CSsemi.CSemiExp semi, string filename)
{
Console.Write("\n line# {0}", repo_.semi.lineCount - 1);
this.display(semi);
}
示例6: indexOfType
public int indexOfType(CSsemi.CSemiExp semi)
{
int indexCL = semi.Contains("class");
int indexIF = semi.Contains("interface");
int indexST = semi.Contains("struct");
int indexEN = semi.Contains("enum");
int index = Math.Max(indexCL, indexIF);
index = Math.Max(index, indexST);
index = Math.Max(index, indexEN);
return index;
}
示例7: doAction
public abstract void doAction(CSsemi.CSemiExp semi);
示例8: doAction
static bool displayStack_ = false; // default
public abstract void doAction(CSsemi.CSemiExp semi, string filename);
示例9: test
abstract public bool test(CSsemi.CSemiExp semi, string filename);
示例10: test
public override bool test(CSsemi.CSemiExp semi, string filename)
{
if (semi[semi.count - 1] != "{")
return false;
int index = semi.FindFirst("(");
List<Elem> table = RepositoryForOutput.storageForOutput_;
CSsemi.CSemiExp local = new CSsemi.CSemiExp();
try
{
if (index > 0 && !isSpecialToken(semi[index - 1]))
{
for (int i = index - 1; i < semi.count; i++)
{
foreach (Elem e in table)
{
if ((e.name.Equals(semi[i])) && !(e.type.Equals("function")) && !(e.type.Equals("namespace")))
{
local.Add("Using").Add(semi[i]).Add(e.filename).Add(e.namespacename);
doActions(local, filename);
return false;
}
}
}
}
}
catch
{
}
return false;
}
示例11: test
public override bool test(CSsemi.CSemiExp semi)
{
if (semi.Contains("{") != -1)
doActions(semi);
return false; // don't stop
}
示例12: display
public override void display(CSsemi.CSemiExp semi)
{
Console.Write("\n line# {0}", repo_.semi.lineCount - 1);
Console.Write("\n ");
for (int i = 0; i < semi.count; ++i)
if (semi[i] != "\n" && !semi.isComment(semi[i]))
Console.Write("{0} ", semi[i]);
}
示例13: aggregationTest
private void aggregationTest(CSsemi.CSemiExp semi, int index, string filename, string filenameto, string namespacename)
{
CSsemi.CSemiExp local = new CSsemi.CSemiExp();
if ((semi[index + 2].Equals(".")))
{
local.Add("Aggregation").Add(semi[index + 3]).Add(semi[index - 2]).Add(filenameto).Add(namespacename);
doActions(local, filename);
}
else
{
local.Add("Aggregation").Add(semi[index + 1]).Add(semi[index - 2]).Add(filenameto).Add(namespacename);
doActions(local, filename);
}
}
示例14: doAction
public override void doAction(CSsemi.CSemiExp semi, string filename)
{
Elem elem = new Elem();
elem.type = semi[0]; // expects type
elem.name = semi[1]; // expects name
elem.filename = filename;
if (elem.type.Equals("namespace"))
elem.namespacename = elem.name;
else
elem.namespacename = namespacematch();
//repo_.stack.push(elem);
repo_.locations.Add(elem);
if(!elem.type.Equals("namespace"))
RepositoryForOutput.storageForOutput_.Add(elem);
if (AAction.displaySemi)
{
Console.Write("\n line# {0,-5}", repo_.semi.lineCount - 1);
Console.Write("entering ");
string indent = new string(' ', 2 * repo_.stack.count);
Console.Write("{0}", indent);
this.display(semi); // defined in abstract action
}
if (AAction.displayStack)
repo_.stack.display();
}
示例15: inheritance
private void inheritance(CSsemi.CSemiExp semi, string filename)
{
ElemRelation elem = new ElemRelation();
elem.filenamefrom = filename;
elem.namespacefrom = namespacematch();
elem.definedType = semi[0];
elem.relationType = semi[1];
elem.fromName = semi[2];
elem.toName = semi[3];
elem.filenameto = semi[4];
elem.namespaceto = semi[5];
RepositoryForRelation.storageForRelationship_.Add(elem);
}