private boolean visitCompleteGrammarBean(Grammar bean,boolean isExtensionGrammar)
	{
		ExtensionGrammar extBean;
		if(isExtensionGrammar) extBean = (ExtensionGrammar) bean;
		else extBean = null;
		boolean hasError = false;
		boolean isDefined;
		// Check that the grammar's grammar-layout symbols are all defined and are all terminals.
		if(bean.getGrammarLayout() != null)
		{
			for(CopperElementReference n : bean.getGrammarLayout())
			{
				isDefined = nameIsDefined(n) && nameIsHost(n);
				hasError |= !isDefined;
				if(isDefined &&
						dereference(n).getType() != CopperElementType.TERMINAL)
				{
					reportError(n.getLocation(),getDisplayName(n) + ", designated as a grammar layout symbol of grammar " + bean.getDisplayName() + ", is not a terminal");
					hasError = true;					
				}
			}
		}
		// Check all the grammar's elements for errors.
		for(CopperElementName n : bean.getGrammarElements())
		{
			if(isExtensionGrammar && extBean.getBridgeProductions().contains(n)) isBridgeProduction = true;
			hasError |= bean.getGrammarElement(n).acceptVisitor(this);
			isBridgeProduction = false;
		}
		return hasError;
	}