Changeset 8574


Ignore:
Timestamp:
Mar 17, 2016 11:57:56 AM (4 years ago)
Author:
vjohnsson
Message:

#4855, #2899: Added a grammar for the variable name syntax and the generated source files. The grammar can be compiled using Bison and Flex. An fmi_import_context_t can be configured to include this syntax check which is logged as errors. Also moved the duplicate variable name check from ComplianceChecker to FMILibrary.

Location:
FMILibrary/trunk
Files:
213 added
15 edited

Legend:

Unmodified
Added
Removed
  • FMILibrary/trunk/Config.cmake/fmixml.cmake

    r3893 r8574  
    1515set(FMIXMLDIR ${FMILIBRARYHOME}/src/XML/)
    1616include(jmutil)
     17
     18################################################################################
     19#generate c source from Bison and Flex files
     20#Download Flex 2.5.4 and Bison 2.7 for windows from http://sourceforge.net/projects/winflexbison
     21if (WIN32)
     22    set(FMILIB_BUILD_LEX_AND_PARSER_FILES FALSE CACHE BOOL "Generate scanner and parser for variable name syntax checking. Requiers Flex and Bison commands to be specified." )
     23    if (${FMILIB_BUILD_LEX_AND_PARSER_FILES})
     24        set(BISON_COMMAND ${FMILIB_THIRDPARTYLIBS}/winflexbison/win_bison.exe CACHE PATH "Command for running bison, e.g C:/win_bison.exe")
     25        set(FLEX_COMMAND ${FMILIB_THIRDPARTYLIBS}/winflexbison/win_flex.exe CACHE PATH "Command for running flex, e.g C:/win_flex.exe")
     26    else()
     27        #Remove variables from cache -> GUI if not used
     28        unset(BISON_COMMAND CACHE)
     29        unset(FLEX_COMMAND CACHE)
     30    endif()
     31endif()
     32
     33#Folder to put generated files in
     34set(FMIXMLGENDIR ${FMIXMLDIR}/src-gen)
     35
     36#Build BISON files
     37set(USE_DEVELOPER_BUILD FALSE) #Enable/disable developer(debug) build
     38if (${USE_DEVELOPER_BUILD})
     39    set(BISON_FMIX_COMMAND_DEBUG -v -t)
     40    set(BISON_FMI2_OUT_DEBUG ${FMIXMLGENDIR}/FMI2/fmi2_xml_variable_name_parser.output)
     41    set(BISON_FMI1_OUT_DEBUG ${FMIXMLGENDIR}/FMI1/fmi1_xml_variable_name_parser.output)
     42endif()
     43set(BISON_FMI2_SRC ${FMIXMLDIR}/src/FMI2/fmi2_xml_variable_name_parser.y)
     44set(BISON_FMI1_SRC ${FMIXMLDIR}/src/FMI1/fmi1_xml_variable_name_parser.y)
     45set(BISON_FMI2_OUT_HEADERS ${FMIXMLGENDIR}/FMI2/fmi2_xml_variable_name_parser.tab.h)
     46set(BISON_FMI1_OUT_HEADERS ${FMIXMLGENDIR}/FMI1/fmi1_xml_variable_name_parser.tab.h)
     47set(BISON_FMI2_OUT_SRC ${FMIXMLGENDIR}/FMI2/fmi2_xml_variable_name_parser.tab.c)
     48set(BISON_FMI1_OUT_SRC ${FMIXMLGENDIR}/FMI1/fmi1_xml_variable_name_parser.tab.c)
     49set(BISON_FMI2_OUT ${BISON_FMI2_OUT_SRC} ${BISON_FMI2_OUT_HEADERS} ${BISON_FMI2_OUT_DEBUG})
     50set(BISON_FMI1_OUT ${BISON_FMI1_OUT_SRC} ${BISON_FMI1_OUT_HEADERS} ${BISON_FMI1_OUT_DEBUG})
     51if (${FMILIB_BUILD_LEX_AND_PARSER_FILES})
     52    add_custom_command(OUTPUT ${BISON_FMI2_OUT} COMMAND ${BISON_COMMAND} ${BISON_FMIX_COMMAND_DEBUG} -Dapi.prefix=yyfmi2 -d ${BISON_FMI2_SRC} DEPENDS ${BISON_FMI2_SRC} WORKING_DIRECTORY ${FMIXMLGENDIR}/FMI2)
     53    add_custom_command(OUTPUT ${BISON_FMI1_OUT} COMMAND ${BISON_COMMAND} ${BISON_FMIX_COMMAND_DEBUG} -Dapi.prefix=yyfmi1 -d ${BISON_FMI1_SRC} DEPENDS ${BISON_FMI1_SRC} WORKING_DIRECTORY ${FMIXMLGENDIR}/FMI1)
     54endif()
     55
     56#Build FLEX files
     57set(FLEX_FMI2_SRC ${FMIXMLDIR}/src/FMI2/fmi2_xml_variable_name_scan.l)
     58set(FLEX_FMI1_SRC ${FMIXMLDIR}/src/FMI1/fmi1_xml_variable_name_scan.l)
     59set(FLEX_FMI2_OUT_HEADERS ${FMIXMLGENDIR}/FMI2/fmi2_xml_variable_name_lex.h)
     60set(FLEX_FMI1_OUT_HEADERS ${FMIXMLGENDIR}/FMI1/fmi1_xml_variable_name_lex.h)
     61set(FLEX_FMI2_OUT_SRC ${FMIXMLGENDIR}/FMI2/lex.yyfmi2.c)
     62set(FLEX_FMI1_OUT_SRC ${FMIXMLGENDIR}/FMI1/lex.yyfmi1.c)
     63set(FLEX_FMI2_OPT_ARG --header-file=${FLEX_FMI2_OUT_HEADERS} -Pyyfmi2)
     64set(FLEX_FMI1_OPT_ARG --header-file=${FLEX_FMI1_OUT_HEADERS} -Pyyfmi1)
     65
     66if (CMAKE_HOST_WIN32)
     67    set(FLEX_FMI2_OPT_ARG ${FLEX_FMI2_OPT_ARG})
     68    set(FLEX_FMI1_OPT_ARG ${FLEX_FMI1_OPT_ARG})
     69endif()
     70if (${FMILIB_BUILD_LEX_AND_PARSER_FILES})
     71    add_custom_command(OUTPUT ${FLEX_FMI2_OUT_SRC} ${FLEX_FMI2_OUT_HEADERS} COMMAND ${FLEX_COMMAND} ${FLEX_FMI2_OPT_ARG} ${FLEX_FMI2_SRC} DEPENDS ${BISON_FMI2_OUT} ${FLEX_FMI2_SRC} WORKING_DIRECTORY ${FMIXMLGENDIR}/FMI2)
     72    add_custom_command(OUTPUT ${FLEX_FMI1_OUT_SRC} ${FLEX_FMI1_OUT_HEADERS} COMMAND ${FLEX_COMMAND} ${FLEX_FMI1_OPT_ARG} ${FLEX_FMI1_SRC} DEPENDS ${BISON_FMI1_OUT} ${FLEX_FMI1_SRC} WORKING_DIRECTORY ${FMIXMLGENDIR}/FMI1)
     73endif()
     74
     75add_definitions(-DYY_NO_UNISTD_H)
     76
     77#end of generate c source from Bison and Flex files
     78################################################################################
    1779
    1880# set(DOXYFILE_EXTRA_SOURCES "${DOXYFILE_EXTRA_SOURCES} \"${FMIXMLDIR}/include\"")
     
    140202set(EXPAT_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/ExpatEx/install/include)
    141203
    142 include_directories("${EXPAT_INCLUDE_DIRS}" "${FMILIB_THIRDPARTYLIBS}/FMI/")
     204include_directories("${EXPAT_INCLUDE_DIRS}" "${FMILIB_THIRDPARTYLIBS}/FMI/" "${FMIXMLGENDIR}/FMI1" "${FMIXMLGENDIR}/FMI2")
    143205
    144206PREFIXLIST(FMIXMLSOURCE  ${FMIXMLDIR}/)
    145207PREFIXLIST(FMIXMLHEADERS ${FMIXMLDIR}/)
    146208
     209list(APPEND FMIXMLSOURCE
     210    ${BISON_FMI2_OUT_SRC}
     211    ${BISON_FMI1_OUT_SRC}
     212    ${FLEX_FMI2_OUT_SRC}
     213    ${FLEX_FMI1_OUT_SRC}
     214)
     215
    147216debug_message(STATUS "adding fmixml")
    148217
  • FMILibrary/trunk/Config.cmake/test_fmi1.cmake

    r8341 r8574  
    6565compress_fmu("${TEST_OUTPUT_FOLDER}" "${FMU_DUMMY_CS_MODEL_IDENTIFIER}" "cs_tc" "fmu1_dll_cs" "${XML_CS_TC_PATH}" "${SHARED_LIBRARY_CS_PATH}")
    6666
     67add_executable (fmi1_check_variable_naming_conventions_test ${RTTESTDIR}/FMI1/fmi1_check_variable_naming_conventions_test.c )
     68target_link_libraries (fmi1_check_variable_naming_conventions_test  ${FMILIBFORTEST}  )
    6769add_executable (fmi_import_xml_test ${RTTESTDIR}/FMI1/fmi_import_xml_test.cc )
    6870target_link_libraries (fmi_import_xml_test  ${FMILIBFORTEST}  )
     
    8284to_native_c_path(${TEST_OUTPUT_FOLDER}/tempfolder FMU_TEMPFOLDER)
    8385
     86add_test(ctest_fmi1_check_variable_naming_conventions_test fmi1_check_variable_naming_conventions_test ${RTTESTDIR}/FMI1/naming_conventions_xmls/)
    8487ADD_TEST(ctest_fmi_import_me_test fmi_import_me_test ${FMU_ME_PATH} ${FMU_TEMPFOLDER})
    8588ADD_TEST(ctest_fmi_import_cs_test fmi_import_cs_test ${FMU_CS_PATH} ${FMU_TEMPFOLDER} "modelDescription_cs.xml")
     
    113116    fmi1_capi_me_test
    114117    fmi1_logger_test
     118    fmi1_check_variable_naming_conventions_test
    115119    PROPERTIES FOLDER "Test/FMI1")
    116120
     
    130134        ctest_fmi1_capi_me_test
    131135        ctest_fmi1_logger_test_run
     136        ctest_fmi1_check_variable_naming_conventions_test
    132137        PROPERTIES DEPENDS ctest_build_all)
    133138endif()
  • FMILibrary/trunk/Config.cmake/test_fmi2.cmake

    r3948 r8574  
    6363to_native_c_path("${TEST_OUTPUT_FOLDER}/${FMU2_DUMMY_CS_MODEL_IDENTIFIER}_mf.fmu" FMU2_MF_PATH)
    6464
     65add_executable (fmi2_check_variable_naming_conventions_test ${RTTESTDIR}/FMI2/fmi2_check_variable_naming_conventions_test.c )
     66target_link_libraries (fmi2_check_variable_naming_conventions_test  ${FMILIBFORTEST}  )
    6567add_executable (fmi2_import_xml_test ${RTTESTDIR}/FMI2/fmi2_import_xml_test.cc )
    6668target_link_libraries (fmi2_import_xml_test  ${FMILIBFORTEST}  )
     
    7072target_link_libraries (fmi2_import_cs_test  ${FMILIBFORTEST}  )
    7173set_target_properties(
     74    fmi2_check_variable_naming_conventions_test
    7275    fmi2_import_xml_test
    7376    fmi2_import_me_test fmi2_import_cs_test
    74     PROPERTIES FOLDER "Test/FMI2")
     77    PROPERTIES FOLDER "Test/FMI2"
     78)
     79set(FAIL_NAME_CHECK 0)
     80set(PASS_NAME_CHECK 1)
     81
     82add_test(ctest_fmi2_check_variable_naming_conventions_test fmi2_check_variable_naming_conventions_test ${RTTESTDIR}/FMI2/naming_conventions_xmls/)
    7583ADD_TEST(ctest_fmi2_import_xml_test_empty fmi2_import_xml_test ${FMU2_DUMMY_FOLDER})
    7684add_test(ctest_fmi2_import_xml_test_me fmi2_import_xml_test ${TEST_OUTPUT_FOLDER}/${FMU2_DUMMY_ME_MODEL_IDENTIFIER}_me)
     
    8391if(FMILIB_BUILD_BEFORE_TESTS)
    8492    SET_TESTS_PROPERTIES (
     93        ctest_fmi2_check_variable_naming_conventions_test
    8594        ctest_fmi2_import_xml_test_me
    8695        ctest_fmi2_import_xml_test_cs
  • FMILibrary/trunk/src/Import/include/FMI/fmi_import_context.h

    r3977 r8574  
    7878
    7979/**
     80    \brief If this configuration option is set, the model description will be
     81    checked to follow the variable naming conventions. Variables not following
     82    the convention will be logged.
     83*/
     84#define FMI_IMPORT_NAME_CHECK 1
     85
     86/**
     87    \brief Sets advanced configuration, if zero is passed default configuration
     88    is set. Currently only one non default configuration is available:
     89    FMI_IMPORT_XML_NAME_CHECK.
     90    @param conf - specifies the configuration to use
     91*/
     92FMILIB_EXPORT void fmi_import_set_configuration( fmi_import_context_t* c, int conf);
     93
     94/**
    8095    \brief Unzip an FMU specified by the fileName into directory dirName and parse XML to get FMI standard version.
    8196    @param c - library context.
  • FMILibrary/trunk/src/Import/src/FMI/fmi_import_context.c

    r3567 r8574  
    3535}
    3636
     37void fmi_import_set_configuration( fmi_import_context_t* c, int conf) {
     38    fmi_xml_set_configuration(c, conf);
     39}
    3740
    3841fmi_version_enu_t fmi_import_get_fmi_version( fmi_import_context_t* c, const char* fileName, const char* dirName) {
  • FMILibrary/trunk/src/Import/src/FMI/fmi_import_context_impl.h

    r3615 r8574  
    3232struct fmi_xml_context_t {
    3333    jm_callbacks* callbacks;
    34    
     34
    3535    XML_Parser parser;
    3636
    3737    fmi_version_enu_t fmi_version;
     38
     39    int configuration;
    3840};
    3941
  • FMILibrary/trunk/src/Import/src/FMI1/fmi1_import.c

    r4862 r8574  
    6666    jm_callbacks* cb;
    6767    fmi1_import_t* fmu;
     68    int configuration;
    6869
    6970    if(!context) return 0;
     
    8283    jm_log_verbose( cb, "FMILIB", "Parsing model description XML");
    8384
    84     if(fmi1_xml_parse_model_description( fmu->md, xmlPath)) {
     85    /* convert the import configuration to the xml configuration */
     86    if (context->configuration & FMI_IMPORT_NAME_CHECK) {
     87        configuration |= FMI1_XML_NAME_CHECK;
     88    }
     89
     90    if(fmi1_xml_parse_model_description( fmu->md, xmlPath, configuration)) {
    8591        fmi1_import_free(fmu);
    8692        cb->free(xmlPath);
  • FMILibrary/trunk/src/Import/src/FMI2/fmi2_import.c

    r6659 r8574  
    6363    char absPath[FILENAME_MAX + 2];
    6464    fmi2_import_t* fmu = 0;
     65    int configuration = 0;
    6566
    6667    if(strlen(dirPath) + 20 > FILENAME_MAX) {
     
    8283        fmu->resourceLocation = fmi_import_create_URL_from_abs_path(context->callbacks, absPath);
    8384    }
    84     fmu->dirPath =  context->callbacks->malloc(strlen(dirPath) + 1);
     85    fmu->dirPath = context->callbacks->malloc(strlen(dirPath) + 1);
    8586    if (!fmu->dirPath ||  !fmu->resourceLocation) {
    8687        jm_log_fatal( context->callbacks, "FMILIB", "Could not allocated memory");
     
    9394    jm_log_verbose( context->callbacks, "FMILIB", "Parsing model description XML");
    9495
    95     if(fmi2_xml_parse_model_description( fmu->md, xmlPath, xml_callbacks)) {
     96    /* convert the import configuration to the xml configuration */
     97    if (context->configuration & FMI_IMPORT_NAME_CHECK) {
     98        configuration |= FMI2_XML_NAME_CHECK;
     99    }
     100
     101    if (fmi2_xml_parse_model_description( fmu->md, xmlPath, xml_callbacks, configuration)) {
    96102        fmi2_import_free(fmu);
    97103        fmu = 0;
  • FMILibrary/trunk/src/XML/include/FMI/fmi_xml_context.h

    r3976 r8574  
    4848void fmi_xml_free_context(fmi_xml_context_t *context);
    4949
     50void fmi_xml_set_configuration( fmi_xml_context_t* context, int configuration);
     51
    5052/** \brief Parse XML file to identify FMI standard version (only beginning of the file is parsed). */
    5153fmi_version_enu_t fmi_xml_get_fmi_version( fmi_xml_context_t*, const char* fileName);
  • FMILibrary/trunk/src/XML/include/FMI1/fmi1_xml_model_description.h

    r3615 r8574  
    105105
    106106/**
     107    \brief If this configuration option is set, the model description will be
     108    checked to follow the variable naming conventions. Variables not following
     109    the convention will be logged.
     110*/
     111#define FMI1_XML_NAME_CHECK 1
     112
     113/**
    107114   \brief Parse XML file
    108115   Repeaded calls invalidate the data structures created with the previous call to fmiParseXML,
     
    111118    @param md A model description object as returned by fmi1_xml_allocate_model_description.
    112119    @param fileName A name (full path) of the XML file name with model definition.
     120    @param configuration Specifies how to parse the model description, 0 is
     121           default. Other possible configuration is FMI_XML_NAME_CHECK.
    113122   @return 0 if parsing was successfull. Non-zero value indicates an error.
    114123*/
    115 int fmi1_xml_parse_model_description( fmi1_xml_model_description_t* md, const char* fileName);
     124int fmi1_xml_parse_model_description( fmi1_xml_model_description_t* md,
     125                                      const char* fileName,
     126                                      int configuration);
    116127
    117128/**
  • FMILibrary/trunk/src/XML/include/FMI2/fmi2_xml_model_description.h

    r6659 r8574  
    101101
    102102/**
     103    \brief If this configuration option is set, the model description will be
     104    checked to follow the variable naming conventions. Variables not following
     105    the convention will be logged.
     106*/
     107#define FMI2_XML_NAME_CHECK 1
     108
     109/**
    103110   \brief Parse XML file
    104111   Repeaded calls invalidate the data structures created with the previous call to fmiParseXML,
     
    108115    @param fileName A name (full path) of the XML file name with model definition.
    109116    @param xml_callbacks Callbacks to use for processing annotations (may be NULL).
     117    @param configuration Specifies how to parse the model description, 0 is
     118           default. Other possible configuration is FMI_XML_NAME_CHECK.
    110119   @return 0 if parsing was successfull. Non-zero value indicates an error.
    111120*/
    112 int fmi2_xml_parse_model_description( fmi2_xml_model_description_t* md, const char* fileName, fmi2_xml_callbacks_t* xml_callbacks);
     121int fmi2_xml_parse_model_description( fmi2_xml_model_description_t* md,
     122                                      const char* fileName,
     123                                      fmi2_xml_callbacks_t* xml_callbacks,
     124                                      int configuration);
    113125
    114126/**
     
    239251fmi2_xml_model_structure_t* fmi2_xml_get_model_structure(fmi2_xml_model_description_t* md);
    240252
     253void fmi2_check_variable_naming_conventions(fmi2_xml_model_description_t *md);
     254
    241255/** @} */
    242256#ifdef __cplusplus
  • FMILibrary/trunk/src/XML/src/FMI/fmi_xml_context.c

    r3938 r8574  
    4242    c->parser = 0;
    4343    c->fmi_version = fmi_version_unknown_enu;
     44    c->configuration = 0;
    4445    jm_log_debug(callbacks, MODULE, "Returning allocated context");
    4546    return c;
     
    5455    }
    5556    context->callbacks->free(context);
     57}
     58
     59void fmi_xml_set_configuration(fmi_xml_context_t *context, int configuration) {
     60    context->configuration = configuration;
    5661}
    5762
  • FMILibrary/trunk/src/XML/src/FMI/fmi_xml_context_impl.h

    r3567 r8574  
    3232struct fmi_xml_context_t {
    3333    jm_callbacks* callbacks;
    34    
     34
    3535    XML_Parser parser;
    3636
    3737    fmi_version_enu_t fmi_version;
     38
     39    int configuration;
    3840};
    3941
  • FMILibrary/trunk/src/XML/src/FMI1/fmi1_xml_parser.c

    r8480 r8574  
    1616#include <string.h>
    1717#include <stdio.h>
     18
     19/* For checking variable naming conventions */
     20#include <fmi1_xml_variable_name_parser.tab.h>
     21#define YYSTYPE YYFMI1STYPE
     22#include <fmi1_xml_variable_name_lex.h>
    1823
    1924#include "fmi1_xml_model_description_impl.h"
     
    528533}
    529534
    530 int fmi1_xml_parse_model_description(fmi1_xml_model_description_t* md, const char* filename) {
     535static void fmi1_check_variable_naming_conventions(fmi1_xml_model_description_t *md) {
     536    size_t n = jm_vector_get_size(jm_named_ptr)(&md->variablesByName);
     537    size_t k;
     538    yyscan_t scanner;
     539    YY_BUFFER_STATE buf;
     540
     541    /* check for duplicate variable names */
     542    for (k = 1; k < n; k++) {
     543        const char *v1 = jm_vector_get_item(jm_named_ptr)(&md->variablesByName, k - 1).name;
     544        const char *v2 = jm_vector_get_item(jm_named_ptr)(&md->variablesByName, k).name;
     545        if(strcmp(v1, v2) == 0) {
     546            jm_log_error(md->callbacks, module,
     547                    "Two variables with the same name %s found. This is not allowed.",
     548                    v1);
     549        }
     550    }
     551
     552    /* check variable name syntax */
     553    if (md->namingConvension == fmi1_naming_enu_structured) {
     554        yyfmi1lex_init(&scanner);
     555        for (k = 0; k < n; k++) {
     556            char *name = ((fmi1_xml_variable_t *) jm_vector_get_item(jm_voidp)(
     557                    md->variablesOrigOrder, k))->name;
     558            buf = yyfmi1_scan_string(name, scanner);
     559            yyfmi1parse(scanner, md->callbacks, name);
     560            yyfmi1_delete_buffer(buf, scanner);
     561        }
     562        yyfmi1lex_destroy(scanner);
     563    }
     564}
     565
     566int fmi1_xml_parse_model_description(fmi1_xml_model_description_t* md, const char* filename, int configuration) {
    531567    XML_Memory_Handling_Suite memsuite;
    532568    fmi1_xml_parser_context_t* context;
     
    622658    }
    623659
     660    if (configuration & FMI1_XML_NAME_CHECK) {
     661        fmi1_check_variable_naming_conventions(md);
     662    }
     663
    624664    md->status = fmi1_xml_model_description_enu_ok;
    625665    context->modelDescription = 0;
  • FMILibrary/trunk/src/XML/src/FMI2/fmi2_xml_parser.c

    r5638 r8574  
    1616#include <string.h>
    1717#include <stdio.h>
     18
     19/* For checking variable naming conventions */
     20#include <fmi2_xml_variable_name_parser.tab.h>
     21#define YYSTYPE YYFMI2STYPE
     22#include <fmi2_xml_variable_name_lex.h>
    1823
    1924#include "fmi2_xml_model_description_impl.h"
     
    615620}
    616621
    617 int fmi2_xml_parse_model_description(fmi2_xml_model_description_t* md, const char* filename, fmi2_xml_callbacks_t* xml_callbacks) {
     622void fmi2_check_variable_naming_conventions(fmi2_xml_model_description_t *md) {
     623    size_t n = jm_vector_get_size(jm_named_ptr)(&md->variablesByName);
     624    size_t k;
     625    yyscan_t scanner;
     626    YY_BUFFER_STATE buf;
     627
     628    /* check for duplicate variable names */
     629    for (k = 1; k < n; k++) {
     630        const char *v1 = jm_vector_get_item(jm_named_ptr)(&md->variablesByName, k - 1).name;
     631        const char *v2 = jm_vector_get_item(jm_named_ptr)(&md->variablesByName, k).name;
     632        if(strcmp(v1, v2) == 0) {
     633            jm_log_error(md->callbacks, module,
     634                    "Two variables with the same name %s found. This is not allowed.",
     635                    v1);
     636        }
     637    }
     638
     639    /* check variable name syntax */
     640    if (md->namingConvension == fmi2_naming_enu_structured) {
     641        yyfmi2lex_init(&scanner);
     642        for (k = 0; k < n; k++) {
     643            char *name = ((fmi2_xml_variable_t *) jm_vector_get_item(jm_voidp)(
     644                    md->variablesOrigOrder, k))->name;
     645            buf = yyfmi2_scan_string(name, scanner);
     646            yyfmi2parse(scanner, md->callbacks, name);
     647            yyfmi2_delete_buffer(buf, scanner);
     648        }
     649        yyfmi2lex_destroy(scanner);
     650    }
     651}
     652
     653int fmi2_xml_parse_model_description(fmi2_xml_model_description_t* md,
     654                                     const char* filename,
     655                                     fmi2_xml_callbacks_t* xml_callbacks,
     656                                     int configuration) {
    618657    XML_Memory_Handling_Suite memsuite;
    619658    fmi2_xml_parser_context_t* context;
     
    695734    }
    696735
     736    if (configuration & FMI2_XML_NAME_CHECK) {
     737        fmi2_check_variable_naming_conventions(md);
     738    }
     739
    697740    md->status = fmi2_xml_model_description_enu_ok;
    698741    context->modelDescription = 0;
Note: See TracChangeset for help on using the changeset viewer.