From c8abf928a1686b935712ff02fdcad085fa48d65f Mon Sep 17 00:00:00 2001 From: Jan Breuer <jan.breuer@jaybee.cz> Date: ćšć, 06 11æ 2014 21:21:17 +0800 Subject: [PATCH] Refactor private lexer and private parser API --- libscpi/inc/scpi/types.h | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/libscpi/inc/scpi/types.h b/libscpi/inc/scpi/types.h index 2bd7c24..29d8bf4 100644 --- a/libscpi/inc/scpi/types.h +++ b/libscpi/inc/scpi/types.h @@ -123,7 +123,7 @@ typedef int (*scpi_error_callback_t)(scpi_t * context, int_fast16_t error); /* scpi lexer */ - enum _token_type_t { + enum _scpi_token_type_t { TokComma, TokSemicolon, TokQuiestion, @@ -150,14 +150,14 @@ TokInvalid, TokUnknown, }; - typedef enum _token_type_t token_type_t; + typedef enum _scpi_token_type_t scpi_token_type_t; - struct _token_t { - token_type_t type; + struct _scpi_token_t { + scpi_token_type_t type; const char * ptr; int len; }; - typedef struct _token_t token_t; + typedef struct _scpi_token_t scpi_token_t; struct _lex_state_t { const char * buffer; @@ -175,8 +175,8 @@ typedef enum _message_termination_t message_termination_t; struct _scpi_parser_state_t { - token_t programHeader; - token_t programData; + scpi_token_t programHeader; + scpi_token_t programData; int numberOfParameters; message_termination_t termination; }; @@ -231,6 +231,7 @@ struct _scpi_param_list_t { const scpi_command_t * cmd; lex_state_t lex_state; + scpi_buffer_t cmd_raw; }; typedef struct _scpi_param_list_t scpi_param_list_t; @@ -240,7 +241,7 @@ int8_t base; scpi_special_number_t type; }; - typedef struct _scpi_number_parameter_t scpi_number_parameter_t; + typedef struct _scpi_number_parameter_t scpi_number_t; struct _scpi_data_parameter_t { const char * ptr; @@ -249,9 +250,9 @@ typedef struct _scpi_data_parameter_t scpi_data_parameter_t; struct _scpi_parameter_t { - token_type_t type; + scpi_token_type_t type; scpi_data_parameter_t data; - scpi_number_parameter_t number; + scpi_number_t number; }; typedef struct _scpi_parameter_t scpi_parameter_t; -- Gitblit v1.9.1