# # = Comment # - = State Area # T = complete-match terminal ???? # S = ANY match. (NOT TERMINAL) # U = Emit now, and re-emit new token immediately # V = like S, but emits token, then does jump. # * = ANY match (TERMINAL) FORMAT: *[chars] [Next State] [TYPE] [VAL] # C = Like V, but advances marker, and does not treat part of current state. (kind of like a cancel) # M = Emit defined state, clear buffer, go to state. # ~ = Anything else, EMIT (as a single char) # = = Anything else (do not emit, but record as current token, more data to come!) # $ = Anything else, do not emit + cancel transaction. ##### This section discusses the binary format. # # #Operations: Jump address is included immediately after compare. # #//define BIT_JUMP 0x01 (All things have jump) # NOTE: Jump to fxxx = error. #define BIT_CLEAR_EXISTING_MARK 0x02 #define BIT_EMIT_BOOKED_TOKEN 0x04 //If set, has token #define BIT_EMIT_THIS_TOKEN_NOW 0x08 //If set, has token #define BIT_SET_TOKEN 0x10 //If set, has token #define BIT_COMPARISON_CHARS 0x20 #define BIT_COMPARISON_STRING 0x40 # # (Clear token?) (Has token?) (Emit... which??) # S: compare individual chars|JUMP |DO NOT CLEAR|NO TOKEN | DO NOT EMIT NOW # U: compare individual chars|JUMP |CLEAR |HAS_TOKEN_FOR_WRITE_NOW | EMIT NOW PREV + PREV # V: compare individual chars|JUMP |DO_NOT_CLEAR|NO_TOKEN | EMIT_NOW PREV ONLY. //NOTE: This was set to "CLEAR" in code. # C: compare individual chars|JUMP |CLEAR |NO_TOKEN | DO NOT EMIT NOW (Clear existing mark) # M: compare whole string |JUMP |CLEAR |HAS_TOKEN_FOR_WRITE_NOW | DO NOT EMIT PREV # # =: do not do comparison |JUMP |DO NOT CLEAR|HAS_TOKEN_FOR_WRITE_FOR_STORE | DO NOT EMIT NOW # K: No comparions |JUMP |CLEAR |NO_TOKEN | NIX < SYM_GT V* SYM_AST V/ SYM_SLA V^ SYM_CARROT V~ SYM_TILDE V! SYM_BANG V| SYM_PIPE V& SYM_AMP V? SYM_QUES V# SYM_HASH # U{ GENERIC_STATE CTRL CTRL_OPEN_BRACE # U[ GENERIC_STATE CTRL CTRL_OPEN_BRAC # U( GENERIC_STATE CTRL CTRL_OPEN_PAREN # U} GENERIC_STATE CTRL CTRL_CLOSE_BRACE # U] GENERIC_STATE CTRL CTRL_CLOSE_BRAC # U) GENERIC_STATE CTRL CTRL_CLOSE_PAREN # U: GENERIC_STATE CTRL CTRL_COLON V{ SYM_BRACE_OPEN V[ SYM_BRAC_OPEN V( SYM_PAREN_OPEN V} SYM_BRACE_CLOSE V] SYM_BRAC_CLOSE V) SYM_PAREN_CLOSE V: SYM_SEMA V" SYM_STRING V' SYM_CHAR V\x20\n\t\r STATE_WHITESPACE =GENERIC_STATE IDENTIFIER REGULAR #Work around, for some reason U malfunctions, so we skip over here. -SYM_BRACE_OPEN +GENERIC_STATE CTRL CTRL_OPEN_BRACE -SYM_BRAC_OPEN +GENERIC_STATE CTRL CTRL_OPEN_BRAC -SYM_PAREN_OPEN +GENERIC_STATE CTRL CTRL_OPEN_PAREN -SYM_BRACE_CLOSE +GENERIC_STATE CTRL CTRL_CLOSE_BRACE -SYM_BRAC_CLOSE +GENERIC_STATE CTRL CTRL_CLOSE_BRAC -SYM_PAREN_CLOSE +GENERIC_STATE CTRL CTRL_CLOSE_PAREN -SYM_COLON_OPEN +GENERIC_STATE CTRL CTRL_COLON -STATE_WHITESPACE C\x20\n\t STATE_WHITESPACE K GENERIC_STATE #Number states: First part. -NUMBER_STATE SxX HEXNUMBER_STATE S0123456789 NUMBER_STATE *uU GENERIC_STATE VALUE V_INT +GENERIC_STATE VALUE V_INT -HEXNUMBER_STATE S0123456789 NUMBER_STATE *uU GENERIC_STATE VALUE V_HEX +GENERIC_STATE VALUE V_HEX -SYM_EQ *= GENERIC_STATE OPERATOR OP_EQUALS +GENERIC_STATE ASSIGN OP_EQUALS -SYM_PLUS *+ GENERIC_STATE OPERATOR OP_PLUSPLUS *= GENERIC_STATE ASSIGN OP_PLUS +GENERIC_STATE OPERATOR OP_PLUS -SYM_MINUS *= GENERIC_STATE ASSIGN OP_MINUS *> GENERIC_STATE OPERATOR OP_DEREFERENCE +GENERIC_STATE OPERATOR OP_MINUS -SYM_LT *= GENERIC_STATE OPERATOR OP_LTEQ S< SYM_LTLT +GENERIC_STATE OPERATOR OP_LT -SYM_LTLT *= GENERIC_STATE ASSIGN OP_LEFTSHIFT +GENERIC_STATE OPERATOR OP_LEFTSHIFT -SYM_GT *= GENERIC_STATE OPERATOR OP_GTEQ S> SYM_GTGT +GENERIC_STATE OPERATOR OP_LTEQ -SYM_GTGT *= GENERIC_STATE ASSIGN OP_RIGHTSHIFT +GENERIC_STATE OPERATOR OP_RIGHTSHIFT -SYM_AST *= GENERIC_STATE ASSIGN OP_ASTERIX +GENERIC_STATE OPERATOR OP_ASTERIX -SYM_QUES +GENERIC_STATE OPERATOR OP_QUESTION -SYM_SLA S* STATE_REGION_COMMENT S/ STATE_LINE_COMMENT *= GENERIC_STATE ASSIGN OP_SLASH +GENERIC_STATE OPERATOR OP_SLASH -STATE_REGION_COMMENT S* STATE_REGION_CHECK_END =STATE_REGION_COMMENT COMMENT COMMENT_RGN -STATE_REGION_CHECK_END C/ GENERIC_STATE =STATE_REGION_COMMENT COMMENT COMMENT_RGN -STATE_LINE_COMMENT C\n STATE_WHITESPACE =STATE_LINE_COMMENT COMMENT COMMENT_RGN #this will nix the character we end on and move into generic_state #-GENERIC_STATE_CLEAR #K GENERIC_STATE -SYM_SEMA +GENERIC_STATE CTRL CTRL_SEMI -SYM_COMMA +GENERIC_STATE CTRL CTRL_COMMA -SYM_CARROT *= GENERIC_STATE ASSIGN OP_NOT +GENERIC_STATE OPERATOR OP_NOT -SYM_TILDE *= GENERIC_STATE ASSIGN OP_XOR +GENERIC_STATE OPERATOR OP_XOR -SYM_PIPE *= GENERIC_STATE ASSIGN OP_BITWISEOR *| GENERIC_STATE OPERATOR OP_LOGICALOR +GENERIC_STATE OPERATOR OP_BITWISEOR -SYM_AMP *= GENERIC_STATE ASSIGN OP_BITWISEAND *& GENERIC_STATE OPERATOR OP_LOGICALAND +GENERIC_STATE OPERATOR OP_BITWISEAND -SYM_BANG *= GENERIC_STATE ASSIGN OP_NOT +GENERIC_STATE OPERATOR OP_NOT -SYM_ESC_STRING =SYM_STRING VALUE V_STRING -SYM_STRING *" GENERIC_STATE VALUE V_STRING V\\ SYM_ESC_STRING =SYM_STRING VALUE V_STRING -SYM_CHAR *" GENERIC_STATE VALUE V_CHAR +GENERIC_STATE VALUE V_CHAR -SYM_HASH Mdefine GENERIC_STATE CMD CMD_DEFINE *\x0a GENERIC_STATE CMD CMD_DIRECTIVE +SYM_HASH COMMENT COMMENT_HASH