Пример #1
0
        //throws RecognitionException, TokenStreamException
        public void mapdef(
            StringTemplateGroup g
            )
        {
            IToken  name = null;

            IDictionary m=null;

            try {      // for error handling
            name = LT(1);
            match(ID);
            match(DEFINED_TO_BE);
            m=map();

                    if ( g.GetMap(name.getText())!=null ) {
                        g.Error("redefinition of map: "+name.getText());
                    }
                    else if ( g.IsDefinedInThisGroup(name.getText()) ) {
                        g.Error("redefinition of template as map: "+name.getText());
                    }
                    else {
                        g.DefineMap(name.getText(), m);
                    }

            }
            catch (RecognitionException ex)
            {
            reportError(ex);
            recover(ex,tokenSet_1_);
            }
        }