本文整理汇总了C#中Stack.And方法的典型用法代码示例。如果您正苦于以下问题:C# Stack.And方法的具体用法?C# Stack.And怎么用?C# Stack.And使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stack
的用法示例。
在下文中一共展示了Stack.And方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PreprocessorCommand
private void PreprocessorCommand(string line, ref int lineNumber, Stack<bool> include, TextReader reader,
IDefineCollection defcol, string currentFile)
{
string newLine;
while (line.EndsWith("/") && (newLine = reader.ReadLine()) != null)
{
line = line.Substring(0, line.Length - 1) + newLine.Trim();
}
if (line.StartsWith(ifDefined))
{
}
else if (line.StartsWith(ifNotDefined))
{
}
else if (line.StartsWith(ifElse))
{
}
else if (line.StartsWith(ifEnd))
{
}
else if (include.And())
{
}
}
示例2: Preprocess
private void Preprocess(TextReader reader, string file, DefineCollection defCol,
ICollection<string> lines, Stack<bool> ifStack)
{
int stackDepth = ifStack.Count;
string line;
bool include = ifStack.And();
while ((line = reader.ReadLine()) != null)
{
line = line.Trim();
if (line.Length > 0)
{
if (line[0] == '#')
{
string[] splitLine = StringExtensions.Split(line,
parameterSplitCharacters, parameterUniterCharacters);
//string[] splitLine = StringHelper.DivideLine(line);
switch (splitLine[0].ToLower())
{
case define:
if (include)
{
if (splitLine.Length > 1)
{
if (splitLine[1].Equals(defineFile))
{
string path = IOHelpers.FindFile(file, splitLine[2]);
if (!string.IsNullOrEmpty(path))
{
IOHelpers.DefineFile(path, defCol);
}
else
{
messageHandler.AddFileNotFoundError(file, line, splitLine[2]);
}
}
else
{
int indexBeg = splitLine[1].IndexOf('(');
int indexEnd = splitLine[1].IndexOf(')');
if (indexBeg >= 0 && indexEnd >= 0 && indexBeg < indexEnd)
{
string parametersList = splitLine[1].Substring(indexBeg + 1, indexEnd - indexBeg - 1);
string[] parameters = parametersList.Split(',');
string original = splitLine[1].Substring(0, indexBeg);
for (int i = 0; i < parameters.Length; i++)
{
parameters[i] = parameters[i].Trim();
}
defCol.Add(original, splitLine[2], parameters);
}
else if (indexBeg == -1 && indexEnd == -1)
{
if (splitLine.Length > 2)
{
defCol.Add(splitLine[1], splitLine[2]);
}
else
{
defCol.Add(splitLine[1], "");
}
}
else
{
messageHandler.AddError(define + " is improperly defined: " + line);
}
}
}
else
{
messageHandler.AddNotEnoughParametersError(file, line, define, 1);
}
}
break;
case unDefine:
if (include)
{
if (splitLine.Length > 1)
{
defCol.Remove(splitLine[1]);
}
else
{
messageHandler.AddNotEnoughParametersError(file, line, unDefine, 1);
}
}
break;
case includeFile:
if (include)
{
if (splitLine.Length > 1)
{
string path = IOHelpers.FindFile(file, splitLine[1]);
if (!string.IsNullOrEmpty(path))
{
string moreText = File.ReadAllText(path);
moreText = this.RemoveComments(moreText);
lines.Add("{");
using (StringReader newReader = new StringReader(moreText))
//.........这里部分代码省略.........
示例3: Preprocess
private void Preprocess(TextReader reader, StringBuilder output,
IDefineCollection defcol, string currentFile, Stack<bool> includeStack)
{
int lineNumber = 1;
string line;
bool blockComment = true;
while ((line = reader.ReadLine()) != null)
{
line = line.Trim();
if (line.Length > 0)
{
//TOFIX?: Handling comments in unincluded lines is extra work.
HandleComments(ref line, ref blockComment);
if (line.Length > 0)
{
if (line[0] == '#')
{
PreprocessorCommand(line, ref lineNumber, includeStack, reader, defcol, currentFile);
}
else if (includeStack.And())
{
ApplyDefines(ref line, lineNumber, currentFile, defcol);
output.AppendLine(line);
}
}
}
lineNumber++;
}
throw new NotImplementedException();
}