module languages/cpp/syntax/Replacement

imports languages/cpp/syntax/Ident
	basic/Strings
	basic/Integers
	

exports

lexical syntax
	"##" -> Cat
	[\!\@\$\%\^\&\*\(\)\-\+\=\[\]\|\<\>\.\/\?\:\~] -> Op
	[\;\,\{\}] -> Punct
	[\'] (Normal|Escaped) [\'] -> CharLit
	[\\][\t\ ]*[\n] -> Cont
	

%% Hack to circumvent bug in ASF library
lexical restrictions
	NatCon -/- [0-9]

context-free syntax
	Id -> Item {cons("id")}
	String -> Item {cons("string")}
	NatCon -> Item {cons("natcon")}
	Cont -> Item {cons("continuation")}
	CharLit -> Item {cons("charlit")}
	Op -> Item {cons("operator")}
	Punct -> Item {cons("punctuation")}

	Item+ -> Replacement



hiddens
sorts Replacement
