Jan Breuer
2015-10-03 988b36805ab5608e759fbf56c8d78a95459c6bd6
Comment numeric list
1个文件已修改
49 ■■■■■ 已修改文件
libscpi/src/expression.c 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
libscpi/src/expression.c
@@ -39,6 +39,16 @@
#include "lexer_private.h"
/**
 * Parse one range or single value
 * @param state lexical state
 * @param isRange return true if parsed expression is range
 * @param valueFrom return parsed value from
 * @param valueTo return parsed value to
 * @return SCPI_EXPR_OK - parsing was succesful
 *         SCPI_EXPR_ERROR - parser error
 *         SCPI_EXPR_NO_MORE - no more data
 */
static scpi_expr_result_t numericRange(lex_state_t * state, scpi_bool_t * isRange, scpi_token_t * valueFrom, scpi_token_t * valueTo)
{
    if (scpiLex_DecimalNumericProgramData(state, valueFrom)) {
@@ -58,6 +68,19 @@
    return SCPI_EXPR_NO_MORE;
}
/**
 * Parse entry on specified position
 * @param context scpi context
 * @param param input parameter
 * @param index index of position (start from 0)
 * @param isRange return true if expression at index was range
 * @param valueFrom return value from
 * @param valueTo return value to
 * @return SCPI_EXPR_OK - parsing was succesful
 *         SCPI_EXPR_ERROR - parser error
 *         SCPI_EXPR_NO_MORE - no more data
 * @see SCPI_ExprNumericListEntryInt, SCPI_ExprNumericListEntryDouble
 */
scpi_expr_result_t SCPI_ExprNumericListEntry(scpi_t * context, scpi_parameter_t * param, int index, scpi_bool_t * isRange, scpi_parameter_t * valueFrom, scpi_parameter_t * valueTo)
{
    lex_state_t lex;
@@ -97,6 +120,19 @@
    return res;
}
/**
 * Parse entry on specified position and convert result to int32_t
 * @param context scpi context
 * @param param input parameter
 * @param index index of position (start from 0)
 * @param isRange return true if expression at index was range
 * @param valueFrom return value from
 * @param valueTo return value to
 * @return SCPI_EXPR_OK - parsing was succesful
 *         SCPI_EXPR_ERROR - parser error
 *         SCPI_EXPR_NO_MORE - no more data
 * @see SCPI_ExprNumericListEntry, SCPI_ExprNumericListEntryDouble
 */
scpi_expr_result_t SCPI_ExprNumericListEntryInt(scpi_t * context, scpi_parameter_t * param, int index, scpi_bool_t * isRange, int32_t * valueFrom, int32_t * valueTo)
{
    scpi_expr_result_t res;
@@ -116,6 +152,19 @@
    return res;
}
/**
 * Parse entry on specified position and convert result to double
 * @param context scpi context
 * @param param input parameter
 * @param index index of position (start from 0)
 * @param isRange return true if expression at index was range
 * @param valueFrom return value from
 * @param valueTo return value to
 * @return SCPI_EXPR_OK - parsing was succesful
 *         SCPI_EXPR_ERROR - parser error
 *         SCPI_EXPR_NO_MORE - no more data
 * @see SCPI_ExprNumericListEntry, SCPI_ExprNumericListEntryInt
 */
scpi_expr_result_t SCPI_ExprNumericListEntryDouble(scpi_t * context, scpi_parameter_t * param, int index, scpi_bool_t * isRange, double * valueFrom, double * valueTo)
{
    scpi_expr_result_t res;