@Override
	public Boolean visitGrammar(Grammar bean)
	throws SAXException
	{
		currentGrammar = bean;
		startElement(XMLSkinElements.Type.GRAMMAR_ELEMENT,"id",bean.getName().toString());
		if(bean.hasDisplayName())
		{
			startElement(XMLSkinElements.Type.PP_ELEMENT);
			out.string(bean.getDisplayName());
			endElement(XMLSkinElements.Type.PP_ELEMENT);
		}
		if(bean.getGrammarLayout() != null)
		{
			startElement(XMLSkinElements.Type.LAYOUT_ELEMENT);
			for(CopperElementReference layout : bean.getGrammarLayout())
			{
				writeGrammarElementRef(layout);
			}
			endElement(XMLSkinElements.Type.LAYOUT_ELEMENT);
		}
		startElement(XMLSkinElements.Type.DECLARATIONS_ELEMENT);
		boolean hasError = false;
		TreeSet<CopperElementName> elements = new TreeSet<CopperElementName>(bean.getGrammarElements()); 
		for(CopperElementName n : elements)
		{
			hasError |= bean.getGrammarElement(n).acceptVisitor(this);
		}
		endElement(XMLSkinElements.Type.DECLARATIONS_ELEMENT);
		endElement(XMLSkinElements.Type.GRAMMAR_ELEMENT);
		return hasError;			
	}