From 1be423e019d9876dbfa20300a481406ad39f05f0 Mon Sep 17 00:00:00 2001 From: Jan Breuer <jan.breuer@jaybee.cz> Date: 周二, 08 10月 2013 19:44:02 +0800 Subject: [PATCH] Add ifndef TRUE/FALSE --- libscpi/inc/scpi/lexer.h | 66 +++++++-------------------------- 1 files changed, 14 insertions(+), 52 deletions(-) diff --git a/libscpi/inc/scpi/lexer.h b/libscpi/inc/scpi/lexer.h index 6aaeca6..ca1dae4 100644 --- a/libscpi/inc/scpi/lexer.h +++ b/libscpi/inc/scpi/lexer.h @@ -43,58 +43,20 @@ extern "C" { #endif -enum _token_type_t { - TokComma, - TokSemicolon, - TokQuiestion, - TokNewLine, - TokHexnum, - TokOctnum, - TokBinnum, - TokProgramMnemonic, - TokDecimalNumericProgramData, - TokSuffixProgramData, - TokArbitraryBlockProgramData, - TokSingleQuoteProgramData, - TokDoubleQuoteProgramData, - TokProgramExpression, - TokCompoundProgramHeader, - TokCommonProgramHeader, - TokCompoundQueryProgramHeader, - TokCommonQueryProgramHeader, - TokWhiteSpace, - TokUnknown, -}; -typedef enum _token_type_t token_type_t; - -struct _token_t { - token_type_t type; - const char * ptr; - int len; -}; -typedef struct _token_t token_t; - -struct _lex_state_t { - const char * buffer; - const char * pos; - int len; -}; -typedef struct _lex_state_t lex_state_t; - - -int SCPI_LexWhiteSpace(lex_state_t * state, token_t * token); -int SCPI_LexProgramHeader(lex_state_t * state, token_t * token); -int SCPI_LexQuestion(lex_state_t * state, token_t * token); -int SCPI_LexCharacterProgramData(lex_state_t * state, token_t * token); -int SCPI_LexDecimalNumericProgramData(lex_state_t * state, token_t * token); -int SCPI_LexSuffixProgramData(lex_state_t * state, token_t * token); -int SCPI_LexNondecimalNumericData(lex_state_t * state, token_t * token); -int SCPI_LexStringProgramData(lex_state_t * state, token_t * token); -int SCPI_LexArbitraryBlockProgramData(lex_state_t * state, token_t * token); -int SCPI_LexProgramExpression(lex_state_t * state, token_t * token); -int SCPI_LexComma(lex_state_t * state, token_t * token); -int SCPI_LexSemicolon(lex_state_t * state, token_t * token); -int SCPI_LexNewLine(lex_state_t * state, token_t * token); + int SCPI_LexIsEos(lex_state_t * state); + int SCPI_LexWhiteSpace(lex_state_t * state, token_t * token); + int SCPI_LexProgramHeader(lex_state_t * state, token_t * token); + int SCPI_LexQuestion(lex_state_t * state, token_t * token); + int SCPI_LexCharacterProgramData(lex_state_t * state, token_t * token); + int SCPI_LexDecimalNumericProgramData(lex_state_t * state, token_t * token); + int SCPI_LexSuffixProgramData(lex_state_t * state, token_t * token); + int SCPI_LexNondecimalNumericData(lex_state_t * state, token_t * token); + int SCPI_LexStringProgramData(lex_state_t * state, token_t * token); + int SCPI_LexArbitraryBlockProgramData(lex_state_t * state, token_t * token); + int SCPI_LexProgramExpression(lex_state_t * state, token_t * token); + int SCPI_LexComma(lex_state_t * state, token_t * token); + int SCPI_LexSemicolon(lex_state_t * state, token_t * token); + int SCPI_LexNewLine(lex_state_t * state, token_t * token); #ifdef __cplusplus } -- Gitblit v1.9.1