Exemple #1
0
 public void AppendMacroToken(MacroToken macroTroken)
 {
     if (replacementTokensList.Count > 0 && macroTroken is TextToken && replacementTokensList.Last() is TextToken)
     {
         replacementTokensList.Last().Text += macroTroken.Text;
     }
     else
     {
         replacementTokensList.Add(macroTroken);
     }
 }
Exemple #2
0
 public void AddToken(MacroToken token)
 {
     if (_tokens.Count > 0 && token is TextToken && _tokens.Last() is TextToken)
     {
         _tokens.Last().Text += token.Text;
     }
     else
     {
         _tokens.Add(token);
     }
 }
Exemple #3
0
 protected string TokenToString(MacroToken token)
 {
     if (token is TextToken)
     {
         return(token.Text);
     }
     if (token is IdentifierToken)
     {
         return(token.Text);
     }
     if (token is FunctionToken)
     {
         return(((FunctionToken)token).GetFunctionText());
     }
     if (token is StringizedToken)
     {
         return(((StringizedToken)token).GetStringizedText());
     }
     if (token is MacroListToken)
     {
         return(((MacroListToken)token).GetText());
     }
     return(String.Empty);
 }