Esempio n. 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_);
            }
        }