Browsable C++ subset Grammar

CC-BY

Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: cpp/subset/bruneliere/extracted
Source used for this grammar: Hugo Brunelière, C++ 1.0, a simplified metamodel corresponding to a small subset of the language, CPP.ecore, 2005/08/05

Summary

Syntax

Integer ::=
	integer
String ::=
	string
Boolean ::=
	"true"
	"false"
CDerived ::=
	CPPReference
CDerived ::=
	CPPExtern
CDerived ::=
	CPPConst
CDerived ::=
	CPPTemplate
CDerived ::=
	CPPReference
	CPPExtern
	CPPConst
	CPPTemplate
CStructured ::=
	CPPClass
CBehavorialFeature ::=
	CFunction
CFunction ::=
	CPPOperation
CFunction ::=
	[isVsrArg]::Boolean
CStructureContents ::=
	CPPOperator
CStructureContents ::=
	CPPOperation
CField ::=
	ε
CDerivableType ::=
	ε
VisibilityKind ::=
	[vk_public]::ε
	[vk_private]::ε
	[vk_protected]::ε
CPPReference ::=
	ε
CPPExtern ::=
	[linkage]::String
CPPConst ::=
	ε
CPPTemplate ::=
	[classes]::CPPClass+
CPPClass ::=
	[isAbstract]::Boolean [isVolatile]::Boolean [visibility]::VisibilityKind [templates]::CPPTemplate+ [generalizations]::CPPGeneralization+
CPPGeneralization ::=
	[visibility]::VisibilityKind [isVirtual]::Boolean [supertype]::CPPClass
CPPOperation ::=
	[isStatic]::Boolean [isExtern]::Boolean [isInline]::Boolean [isVirtual]::Boolean [isPure]::Boolean [visibility]::VisibilityKind [isCtor]::Boolean [isDtor]::Boolean [throws]::CPPClass+
CPPOperator ::=
	[isInline]::Boolean [visibility]::VisibilityKind
CPPMember ::=
	[isStatic]::Boolean [isVolatile]::Boolean [isRegister]::Boolean [visibility]::VisibilityKind

GrammarLabMaintained by Dr. Vadim Zaytsev a.k.a. @grammarware. Last updated in September 2015. []