示例#1
0
 private void HandleMacroListTokens(MacroToken token, ref MacroListToken collection)
 {
     if (token is MacroListToken)
     {
         collection.AddRangeTokens(((MacroListToken)token).Tokens);
     }
     else
     {
         collection.AddToken(token);
     }
 }
示例#2
0
        public override MacroToken VisitArguments(MacroParser.ArgumentsContext context)
        {
            var tokens = new MacroListToken();

            tokens.AddToken(new TextToken(context.LPAREN().GetText()));
            var argumentsTokens = Visit(context.args()) as MacroListToken;

            if (argumentsTokens != null)
            {
                tokens.AddRangeTokens(argumentsTokens.Tokens);
            }
            tokens.AddToken(new TextToken(context.RPAREN().GetText()));
            return(tokens);
        }