module BNFC.Backend.CPP.Naming where import BNFC.Utils cReservedWords, cppReservedWords :: [String] cReservedWords :: [String] cReservedWords = [ String "auto", String "const", String "double", String "float", String "int", String "short", String "struct" , String "unsigned", String "break", String "continue", String "else", String "for", String "long", String "signed" , String "switch", String "void", String "case", String "default", String "enum", String "goto", String "register", String "sizeof" , String "typedef", String "volatile", String "char", String "do", String "extern", String "if", String "return", String "static" , String "union", String "while" ] cppReservedWords :: [String] cppReservedWords = [String] cReservedWords [String] -> [String] -> [String] forall a. [a] -> [a] -> [a] ++ [ String "asm", String "dynamic_cast", String "namespace" , String "reinterpret_cast" , String "try", String "bool", String "explicit", String "new", String "static_cast" , String "typeid", String "catch" , String "false", String "operator", String "template", String "typename", String "class" , String "friend" , String "private", String "this", String "using", String "const_cast", String "inline", String "public" , String "throw" , String "virtual", String "delete", String "mutable", String "protected", String "true", String "wchar_t" , String "and", String "bitand", String "compl", String "not_eq", String "or_eq", String "xor_eq", String "and_eq", String "bitor" , String "not", String "or", String "xor" ] mkVariable :: String -> String mkVariable :: String -> String mkVariable = [String] -> NameStyle -> String -> String mkName [String] cppReservedWords NameStyle SnakeCase sanitizeC :: String -> String sanitizeC :: String -> String sanitizeC = [String] -> NameStyle -> String -> String mkName [String] cReservedWords NameStyle OrigCase sanitizeCpp :: String -> String sanitizeCpp :: String -> String sanitizeCpp = [String] -> NameStyle -> String -> String mkName [String] cppReservedWords NameStyle OrigCase