Add sources

This commit is contained in:
2018-06-05 22:30:22 +02:00
parent e28912dc5e
commit 9b56ec979d
143 changed files with 8636 additions and 0 deletions

34
definitions/keywords.def Normal file
View File

@@ -0,0 +1,34 @@
DEF("namespace", NAMESPACE)
DEF("struct", STRUCT)
DEF("class", CLASS)
DEF("union", UNION)
DEF("enum", ENUM)
DEF("break", BREAK)
DEF("continue", CONTINUE)
DEF("return", RETURN)
DEF("goto", GOTO)
DEF("if", IF)
DEF("else", ELSE)
DEF("switch", SWITCH)
DEF("for", FOR)
DEF("while", WHILE)
DEF("do", DO)
DEF("case", CASE)
DEF("default", DEFAULT)
DEF("try", TRY)
DEF("catch", CATCH)
DEF("template", TEMPLATE)
DEF("using", USING)
DEF("static_assert", STATIC_ASSERT)
DEF("typename", TYPENAME)
DEF("extern", EXTERN)
DEF("asm", ASM)

View File

@@ -0,0 +1,74 @@
/**
* http://en.cppreference.com/w/cpp/language/operator_precedence
*/
// Prefix increment and decrement
UNARY(PLUS_PLUS, 3)
UNARY(MINUS_MINUS, 3)
// Unary plus and minus
UNARY(PLUS, 3)
UNARY(MINUS, 3)
// Logical NOT and bitwise NOT
UNARY(TILDE, 3)
UNARY(EXCLAMATION, 3)
// Multiplication, division, and remainder
BINARY(ASTERISK, 5)
BINARY(SLASH, 5)
BINARY(PERCENT, 5)
// Addition and subtraction
BINARY(PLUS, 6)
BINARY(MINUS, 6)
// Bitwise left shift and right shift
BINARY(LT_LT, 7)
BINARY(GT_GT, 7)
// For relational operators < and ≤ respectively
BINARY(LT, 8)
BINARY(LT_EQUAL, 8)
// For relational operators > and ≥ respectively
BINARY(GT, 8)
BINARY(GT_EQUAL, 8)
// For relational = and ≠ respectively
BINARY(EQUAL_EQUAL, 9)
BINARY(EXCLAMATION_EQUAL, 9)
// Bitwise AND
BINARY(AMPERSAND, 10)
// Bitwise XOR (exclusive or)
BINARY(CIRCUMFLEX, 11)
// Bitwise OR (inclusive or)
BINARY(PIPE, 12)
// Logical AND
BINARY(AMPERSAND_AMPERSAND, 13)
// Logical OR
BINARY(PIPE_PIPE, 14)
// Assignements
BINARY(EQUAL, 15)
BINARY(PLUS_EQUAL, 15)
BINARY(MINUS_EQUAL, 15)
BINARY(ASTERISK_EQUAL, 15)
BINARY(SLASH_EQUAL, 15)
BINARY(PERCENT_EQUAL, 15)
BINARY(LT_LT_EQUAL, 15)
BINARY(GT_GT_EQUAL, 15)
BINARY(AMPERSAND_EQUAL, 15)
BINARY(CIRCUMFLEX_EQUAL, 15)
BINARY(PIPE_EQUAL, 15)
/**
* New operators
*/
// ...

47
definitions/symbols.def Normal file
View File

@@ -0,0 +1,47 @@
// relation operators
DEF("==", EQUAL_EQUAL)
DEF("!=", EXCLAMATION_EQUAL)
DEF("<", LT)
DEF("<=", LT_EQUAL)
DEF(">", GT)
DEF(">=", GT_EQUAL)
// assignement operators
DEF("=", EQUAL)
DEF("+=", PLUS_EQUAL)
DEF("-=", MINUS_EQUAL)
DEF("*=", ASTERISK_EQUAL)
DEF("/=", SLASH_EQUAL)
DEF("%=", PERCENT_EQUAL)
DEF("<<=", LT_LT_EQUAL)
DEF(">>=", GT_GT_EQUAL)
DEF("&=", AMPERSAND_EQUAL)
DEF("^=", CIRCUMFLEX_EQUAL)
DEF("|=", PIPE_EQUAL)
// arithmetic operators
DEF("++", PLUS_PLUS)
DEF("--", MINUS_MINUS)
DEF("+", PLUS)
DEF("-", MINUS)
DEF("*", ASTERISK)
DEF("/", SLASH)
DEF("%", PERCENT)
// bitwise operators
DEF("~", TILDE)
DEF("&", AMPERSAND)
DEF("^", CIRCUMFLEX)
DEF("|", PIPE)
DEF("<<", LT_LT)
DEF(">>", GT_GT)
// logical operators
DEF("!", EXCLAMATION)
DEF("&&", AMPERSAND_AMPERSAND)
DEF("||", PIPE_PIPE)

10
definitions/types.def Normal file
View File

@@ -0,0 +1,10 @@
DEF("char", CHAR)
DEF("uchar", UCHAR)
DEF("short", SHORT)
DEF("ushort", USHORT)
DEF("int", INT)
DEF("uint", UINT)
DEF("long", LONG)
DEF("ulong", ULONG)
DEF("float", FLOAT)
DEF("double", DOUBLE)