internal ValueCollection(HashList hashList)
 {
     _hashList = hashList;
 }
 internal KeyCollection(HashList hashList)
 {
     _hashList = hashList;
 }
        //throws RecognitionException, TokenStreamException
        public void template(
            StringTemplateGroupInterface groupI
            )
        {
            IToken  opt = null;
            IToken  name = null;

            HashList formalArgs = new HashList(); // leave blank if no args
            string templateName=null;

            try {      // for error handling
            {
                switch ( LA(1) )
                {
                case LITERAL_optional:
                {
                    opt = LT(1);
                    match(LITERAL_optional);
                    break;
                }
                case ID:
                {
                    break;
                }
                default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
                 }
            }
            name = LT(1);
            match(ID);
            match(LPAREN);
            {
                switch ( LA(1) )
                {
                case ID:
                {
                    formalArgs=args();
                    break;
                }
                case RPAREN:
                {
                    break;
                }
                default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
                 }
            }
            match(RPAREN);
            match(SEMI);

            templateName = name.getText();
            groupI.DefineTemplate(templateName, formalArgs, opt!=null);

            }
            catch (RecognitionException ex)
            {
            reportError(ex);
            recover(ex,tokenSet_1_);
            }
        }
 internal HashListEnumerator(HashList hashList, EnumerationMode mode)
 {
     _hashList = hashList;
     _mode = mode;
     _version = hashList._version;
     _orderList = hashList._insertionOrderList;
     _index = 0;
     _key = null;
     _value = null;
 }
        //throws RecognitionException, TokenStreamException
        public HashList args()
        {
            HashList args=new HashList();

            IToken  a = null;
            IToken  b = null;

            try {      // for error handling
            a = LT(1);
            match(ID);
            args[a.getText()] = new FormalArgument(a.getText());
            {    // ( ... )*
                for (;;)
                {
                    if ((LA(1)==COMMA))
                    {
                        match(COMMA);
                        b = LT(1);
                        match(ID);
                        args[b.getText()] = new FormalArgument(b.getText());
                    }
                    else
                    {
                        goto _loop9_breakloop;
                    }

                }
            _loop9_breakloop:				;
            }    // ( ... )*
            }
            catch (RecognitionException ex)
            {
            reportError(ex);
            recover(ex,tokenSet_2_);
            }
            return args;
        }