From 4d39507183e0ace2d73f04817a398e858b66b677 Mon Sep 17 00:00:00 2001 From: Jan Breuer <jan.breuer@jaybee.cz> Date: 周五, 22 3月 2013 01:40:22 +0800 Subject: [PATCH] Update lexer, start of implementing parser --- libscpi/src/parser.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 50 insertions(+), 0 deletions(-) diff --git a/libscpi/src/parser.c b/libscpi/src/parser.c index 2ff12c2..df73700 100644 --- a/libscpi/src/parser.c +++ b/libscpi/src/parser.c @@ -39,6 +39,7 @@ #include "scpi/config.h" #include "scpi/parser.h" +#include "scpi/lexer.h" #include "utils.h" #include "scpi/error.h" @@ -664,3 +665,52 @@ return FALSE; } + + + +void SCPI_ProgramMessageUnit(scpi_t * context) { + lex_state_t state; + token_t tmp; + token_t header; + token_t token; + + state.buffer = state.pos = context->buffer.data; + state.len = context->buffer.position; + + /* ignore whitespace at the begginig */ + SCPI_LexWhiteSpace(&state, &tmp); + + SCPI_LexProgramHeader(&state, &header); + + SCPI_LexWhiteSpace(&state, &tmp); + + SCPI_ParseProgramDate(context, &state, &token); + + SCPI_LexWhiteSpace(&state, &tmp); + + { + SCPI_LexComma(&state, &token); + + SCPI_LexWhiteSpace(&state, &tmp); + + SCPI_ParseProgramDate(context, &state); + + SCPI_LexWhiteSpace(&state, &tmp); + } + + SCPI_LexNewLine(&state, &tmp); +} + + + + + + + + + + + + + + -- Gitblit v1.9.1