Browsable C subset Grammar

CC-BY

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

Summary

Syntax

Integer ::=
	integer
String ::=
	string
Boolean ::=
	"true"
	"false"
CDataType ::=
	CIntegral
CDataType ::=
	CFloating
CDataType ::=
	CBitField
CDataType ::=
	CVoid
CDataType ::=
	CIntegral
	CFloating
	CBitField
	CVoid
CIntegral ::=
	CEnumeration
CIntegral ::=
	CInt
CIntegral ::=
	CChar
CIntegral ::=
	CEnumeration
	CInt
	CChar
CFloating ::=
	CDouble
CFloating ::=
	CFloat
CFloating ::=
	CLongDouble
CFloating ::=
	CDouble
	CFloat
	CLongDouble
CBitField ::=
	ε
CVoid ::=
	ε
CEnumeration ::=
	ε
CInt ::=
	CUnsignedInt
CInt ::=
	CLong
CInt ::=
	CLongLong
CInt ::=
	CShort
CInt ::=
	CUnsignedInt
	CLong
	CLongLong
	CShort
CChar ::=
	CSignedChar
CChar ::=
	CUnsignedChar
CChar ::=
	CWChar
CChar ::=
	CSignedChar
	CUnsignedChar
	CWChar
CDouble ::=
	ε
CFloat ::=
	ε
CLongDouble ::=
	ε
CUnsignedInt ::=
	UnsignedLong
CUnsignedInt ::=
	UnsignedLongLong
CUnsignedInt ::=
	UnsignedShort
CUnsignedInt ::=
	UnsignedLong
	UnsignedLongLong
	UnsignedShort
CLong ::=
	ε
CLongLong ::=
	ε
CShort ::=
	ε
CSignedChar ::=
	ε
CUnsignedChar ::=
	ε
CWChar ::=
	ε
UnsignedLong ::=
	ε
UnsignedLongLong ::=
	ε
UnsignedShort ::=
	ε
CClassifier ::=
	CDataType
CClassifier ::=
	Derived
CClassifier ::=
	CStructured
CClassifier ::=
	CDataType
	Derived
Derived ::=
	ε
CStructureContents ::=
	CStructuralFeature
CStructureContents ::=
	CStructured
CStructureContents ::=
	[sc_container]::CStructured
CStructured ::=
	CStruct
CStructured ::=
	CUnion
CStructured ::=
	[contains]::CStructureContents+
CStruct ::=
	[contains]::CStructureContents+
CUnion ::=
	[contains]::CStructureContents+
CSourceText ::=
	[source]::String [fileName]::String
CTypedElement ::=
	CParameter
CTypedElement ::=
	CStructuralFeature
CTypedElement ::=
	[type]::CClassifier [source]::CSourceText
CStructuralFeature ::=
	CField
CField ::=
	ε
CParameter ::=
	[behavioralFeature]::BehavioralFeature
BehavioralFeature ::=
	CFunction
BehavioralFeature ::=
	[parameters]::CParameter+
CFunction ::=
	[isVarArg]::Boolean

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