本文整理汇总了C#中CSsemi.FindFirst方法的典型用法代码示例。如果您正苦于以下问题:C# CSsemi.FindFirst方法的具体用法?C# CSsemi.FindFirst怎么用?C# CSsemi.FindFirst使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSsemi
的用法示例。
在下文中一共展示了CSsemi.FindFirst方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: test
public override bool test(CSsemi.CSemiExp semi, string filename)
{
if (semi[semi.count - 1] != "{")
return false;
int index = semi.FindFirst("(");
if (index > 0 && !isSpecialToken(semi[index - 1]))
{
CSsemi.CSemiExp local = new CSsemi.CSemiExp();
local.Add("function").Add(semi[index - 1]);
doActions(local, filename);
return true;
}
return false;
}
示例2: 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;
}
示例3: containFunctionName
// wether the semi contain name of function
bool containFunctionName(CSsemi.CSemiExp semi)
{
if (semi[semi.count - 1] == "{") // found "{"
{
int index = semi.FindFirst("(");
if (index > 0 && !DetectFunction.isSpecialToken(semi[index - 1])) // and found "(" before "{" and at least a token before "("
return true;
else
return false;
}
else
return false;
}
示例4: test
public override bool test(CSsemi.CSemiExp semi)
{
if (semi[semi.count - 1] != "{")
return false;
// strip off leading #if(TEST_XYZ) if it's in this semi
if (semi.FindFirst("#") != -1)
{
int loc = semi.FindFirst(")");
for (int i = 0; i <= loc; ++i)
semi.remove(0);
}
// now find function
int index = semi.FindFirst("(");
if (index > 0 && !isSpecialToken(semi[index - 1]))
{
CSsemi.CSemiExp local = new CSsemi.CSemiExp();
local.Add("function").Add(semi[index - 1]);
doActions(local);
return true;
}
return false;
}
示例5: test
public override bool test(CSsemi.CSemiExp semi)
{
Repository repo_ = Repository.getInstance();
int index = semi.FindFirst("new");
if (index != -1)
{
string currclassName = DetectParentClass.getClassName(repo_.semi.lineCount);
CSsemi.CSemiExp local = new CSsemi.CSemiExp();
// local semiExp with tokens for type and name
local.displayNewLines = false;
local.Add(semi[index + 1]).Add(semi[index - 2]).Add(currclassName);
doActionsAggregation(local);
return true;
}
return false;
}
示例6: test
public override bool test(CSsemi.CSemiExp semi)
{
Display.displayRules(actionDelegate, "rule DetectFunction");
if (semi[semi.count - 1] != "{")
return false;
int index = semi.FindFirst("(");
if (index > 0 && !isSpecialToken(semi[index - 1]))
{
CSsemi.CSemiExp local = new CSsemi.CSemiExp();
local.Add("function").Add(semi[index - 1]);
doActions(local);
return true;
}
return false;
}
示例7: test
public override bool test(CSsemi.CSemiExp semi, string file)
{
try
{
if (semi[semi.count - 1] != "{")
return false;
int index = semi.FindFirst("(");
if (index > 0 && !isSpecialToken(semi[index - 1]))
{
List<Elem> output = OutputRepository.output_;
foreach (Elem e in output)
{
for (int i = 0; i < semi.count - 1; i++)
{
if (e.name.Equals(semi[i]) && !e.type.Equals("namespace") && !e.type.Equals("function"))
{
CSsemi.CSemiExp local = new CSsemi.CSemiExp();
local.Add("Using").Add(semi[i]);
doActions(local, file);
return true;
}
}
}
}
}
catch { }
return false;
}
示例8: test
public override bool test(CSsemi.CSemiExp semi)
{
if (semi[semi.count - 1] != "{" )
return false;
int index = semi.FindFirst("(");
if (semi[index + 1] == ")")
return false;
if (index > 0 && !isSpecialToken(semi[index - 1]))
{
CSsemi.CSemiExp local = new CSsemi.CSemiExp();
if (semi.Contains(".") != -1)
index = semi.FindFirst(".");
local.Add("Using").Add(semi[index + 1]);
doActions(local);
return true;
}
return false;
}