A2L头文件解析(基于CCP协议)

1.标定量如何分区(注意:标定量的地址在flash上,所以在初始化阶段应该讲flash搬到ram中去)


      /begin MEMORY_SEGMENT _RAM
        "calibration_ram"
        DATA
        RAM
        INTERN
        0x40004C00     // 标定量对应在RAM的区域(需将FLASH的标定量复制到这个区)
        0x00002000     // 标定量的大小
        -1 -1 -1 -1 -1
      /end MEMORY_SEGMENT
      /begin MEMORY_SEGMENT _ROM
        "calibration_rom"
        DATA
        FLASH
        INTERN
        0x00008000       // 标定量对应在RAM的区域(需将FLASH的标定量复制到这个区)
        0x00002000       // 标定量的大小
        -1 -1 -1 -1 -1

2.将标定数据对应的FLASH和RAM项链接

 /begin IF_DATA ASAP1B_CCP
            ADDRESS_MAPPING /*orig_adr:*/ 0x00008000 /*mapping_adr:*/ 0x40004C00 /*length:*/ 0x2000          // 标   定量空间的映射(flash--> ram)
  /end IF_DATA

3.定义好参考页和工作页

        2
        "calibration_ram"
        0
        0x40004C00     // 标定量在RAM  ---> 参考区
        0x00002000
        RAM
        RAM_INIT_BY_TOOL
      /end DEFINED_PAGES

      /begin DEFINED_PAGES
        1
        "calibration_rom"  // 标定量在FLASH  ---> 参考区
        0
        0x00008000
        0x00002000
        FLASH
      /end DEFINED_PAGES

下面是某个A2L的头部分,观测量和标定量的信息可通过MATLAB生成。

ASAP2_VERSION 1 31 /* Version 1.31 */

/begin PROJECT ProjectName "Project Comment Goes Here"

  /begin HEADER "Header Comments go here"

  /end HEADER


  /begin MODULE ModuleName "Module Comment Goes Here"
    /begin A2ML
      /****************************************************************************/
      /*                                                                          */
      /*   ASAP2 Meta Language for CCP CAN Calibration Protocol V2.1              */
      /*   Assumes ASAP2 V1.3 or later                                            */
      /*                                                                          */
      /*   AML Version V2.4, 27.04.1999                                           */
      /*                                                                          */
      /*           仅供参考                 */
      /*                                                                         */
      /*                                                                          */
      /*                                                                          */
      /*                                                                          */
      /*   Datatypes:                                                             */
      /*                                                                          */
      /*   A2ML       ASAP2          Windows  Erlaeuuterung                       */
      /*   ----------------------------------------------------------------       */
      /*   uchar      UBYTE          BYTE     unsigned 8 Bit                      */
      /*   char       SBYTE          char     signed 8 Bit                        */
      /*   uint       UWORD          WORD     unsigned integer 16 Bit             */
      /*   int        SWORD          int      signed integer 16 Bit               */
      /*   ulong      ULONG          DWORD    unsigned integer 32 Bit             */
      /*   long       SLONG          LONG     signed integer 32 Bit               */
      /*   float      FLOAT32_IEEE            float 32 Bit                        */
      /*                                                                          */
      /****************************************************************************/
      /*2012.9.12*/
      block "IF_DATA" taggedunion if_data { /*lzf 2012.10.30*/
        "ASAP1B_CCP" taggedstruct {

          /* Beschreibung der DAQ-Listen */
          (block "SOURCE" struct {

            struct {
              char[101]; /* Name of the DAQ-List (data acquisition list),
       measurement source .        */

                /* If the DAQ-Liste only supports one fixed ECU 
       sampling rate, it can be declared below
       to achieve compatibility with the ASAP2 standard.
       Otherwise description of the possible ECU
       sampling rates in QP_BLOB      */
              int; /* Period definition : Basic scaling unit in 
       CSE defined in ASAP1b (CSE=Code for Scaling Unit) */
              long; /* Period definition : Rate in Scaling Units */
            };


            taggedstruct {

              "DISPLAY_IDENTIFIER" char[32];

              block "QP_BLOB" struct {

                uint; /* Number of the DAQ-List 0..n               */

                taggedstruct {
                  "LENGTH" uint; /* Length of the DAQ-Liste, maximum number of
       the useable ODTs                          */

                  "CAN_ID_VARIABLE"; /* CAN-Message-ID is variable                */

                  "CAN_ID_FIXED" ulong;
                    /* CAN-Message-ID of the DTOs is fixed,
       Default DTO
       Bit31 = 1: extended Identifier
       Bit31 = 0: standard Identifier            */

                    /* Not applied if the ECU uses the DTM-Id    */

                  ("RASTER" uchar)*;
                    /* Supported CCP Event Channel Names
       of this DAQ List */

                  ("EXCLUSIVE" int)*;
                    /* Exclusion of other DAQ-Lists              */

                  "REDUCTION_ALLOWED";
                    /* Data reduction possible                   */

                  "FIRST_PID" uchar; /* First Packet ID (PID) of the DAQ List     */
                };
              };
            };
          })*;


            /* Description of the available ECU Sampling Rates (Event Channels)      */
          (block "RASTER" struct {

            char[101]; /* CCP Event Channel Name                               */
            char[9]; /* Short Display Name of the Event Channel Name         */
            uchar; /* Event Channel No., used for CCP START_STOP)          */
            int; /* Period definition :  basic scaling unit in CSE
       as defined in ASAP1b                                 */
            long; /* ECU sample rate of the event channel,
       period definition based on the basic scaling unit    */

            taggedstruct {
              ("EXCLUSIVE" uchar)*;
                /* Exclusion of other CCP Event Channels                */
            };

          })*;

            /* Group several event channels to form one combined event */
            /* e.g. group all cylinder synchronous events to one combined element */
          (block "EVENT_GROUP" struct {

            char[101]; /* Event group name */
            char[9]; /* Short name for the event group */
            taggedstruct {
              ("RASTER" uchar)*;
            };
              /* all event channels beloging to group
       (CCP Event Channel Numbers for START_STOP)               */
          })*;


            /* Description of the authentification process */
          block "SEED_KEY" struct {
            char[256]; /* Name of the Seed&Key DLL for CAL Priviledge,
       including file-Extension without path */
            char[256]; /* Name of the Seed&Key DLL for DAQ Priviledge,
       including file-Extension without path */
            char[256]; /* Name of the Seed&Key DLL for PGM Priviledge,
       including file-Extension without path */
          };


            /* Description of the checksum calculation process */
          block "CHECKSUM" struct {
            char[256]; /* Name of the Checksum DLL representing the ECU Algorithm, 
       including file-Extension without path */
          };


          block "TP_BLOB" struct {

            uint; /* CCP Version,       High Byte: Version
       Low Byte : subversion (dec.)            */
            uint; /* Blob-Version,      High Byte: Version
       Low Byte : subversion (dec.)            */
            ulong; /* CAN-Message ID for 'Transmitting to ECU (CRM)'
       Bit31 = 1: extended Identifier
       Bit31 = 0: standard Identifier          */
            ulong; /* CAN-Message ID for 'Receiving from ECU (DTM)'
       Bit31 = 1: extended Identifier
       Bit31 = 0: standard Identifier          */
            uint; /* Logical CCP-Address of the (station address)           */
            uint; /* Byte order of Multiple-byte-items
       1 = high Byte first, 2 = low byte first */
            taggedstruct {

              block "CAN_PARAM" struct {
                uint; /* Quartz freq. of the elec. control unit  */
                uchar; /* BTR0                                    */
                uchar; /* BTR1                                    */
              };

              "BAUDRATE" ulong; /* Baud rate in Hz.                        */
              "SAMPLE_POINT" uchar; /* sampling point of time in percent       */
              "SAMPLE_RATE" uchar; /* number of samples per Bit (1 oder 3)    */
              "BTL_CYCLES" uchar; /* number of BTL-cycles                    */
              "SJW" uchar; /* SJW-parameter in BTL-cycles             */
              "SYNC_EDGE" enum {
                "SINGLE" = 0, /* Synchronisation only on fallende edge   */
                "DUAL" = 1 /* Synchr. on falling and rising edge      */
              };

              "DAQ_MODE" enum { /* mode of cylcic data acquisition         */
                "ALTERNATING" = 0, /* ECU is sending one ODT per cycle        */
                "BURST" = 1 /* ECU is sending a complete DAQ           */
              };

              "BYTES_ONLY"; /* ECU supports max. elements of one Byte size */
                /* otherwise ECU supports different dataTypes  */

              "RESUME_SUPPORTED"; /* ECU supports the Resume function            */

              "STORE_SUPPORTED"; /* ECU supports the Store function             */

              "CONSISTENCY" enum {
                "DAQ" = 0, /* consistency of a complete DAQ ist guaranteed */
                "ODT" = 1 /* consistency of a complete ODT ist guaranteed */
              };

              "ADDRESS_EXTENSION" enum { /* address extension                      */
                "DAQ" = 0, /* ECU supports only one Address extension
       within an DAQ                    */
                "ODT" = 1 /* ECU supports only one Address extension
       within an ODT                    */
              };

              block "CHECKSUM_PARAM" struct {
                uint; /* checksum calculation procedure
       standard types not yet defined,
       if greater of equal 1000 : manufacturer specific  */

                ulong; /* Maximum block length used by an ASAP1a-CCP
       command, for checksum calculation procedure  */

                taggedstruct {
                  "CHECKSUM_CALCULATION" enum {
                    "ACTIVE_PAGE" = 0,
                    "BIT_OR_WITH_OPT_PAGE" = 1
                  };
                };
              };

              (block "DEFINED_PAGES" struct {
                struct {
                  uint; /* Logical No. of the memory page (1,2,..)   */
                  char[101]; /* Name of the memory page                   */
                  uint; /* Adress-Extension of the memory page (only
       Low Byte significant)                     */
                  ulong; /* Base address of the memory page           */
                  ulong; /* Length of the memory page in Bytes        */
                };
                taggedstruct {
                  "RAM"; /* memory page in RAM */
                  "ROM"; /* memory page in ROM */
                  "FLASH"; /* memory page in FLASH */
                  "EEPROM"; /* memory page in EEPROM */
                  "RAM_INIT_BY_ECU"; /* memory page is initialised by ECU start-up */
                  "RAM_INIT_BY_TOOL"; /* RAM- memory page is initialised by the MCS */
                  "AUTO_FLASH_BACK"; /* RAM memory page is automatically flashed back */
                  "FLASH_BACK"; /* feature available to flash back the RAM memory page */
                  "DEFAULT"; /* memory page is standard (fallback mode) */
                };
              })*;

              ("OPTIONAL_CMD" uint)*; /* CCP-Code of the optional command available
       in the ECU. It is recommended to declare all
       non-standard ECU commands here */

            };

          };

            /* for CHARACTERISTIC and AXIS_PTS and MEMORY_LAYOUT */
          "DP_BLOB" struct {
            uint; /* Address extension of the calibration data
       (only Low Byte significant) */
            ulong; /* Base address of the calibration data */
            ulong; /* Number of Bytes belonging to the calibration data  */
          };

            /* for MEASUREMENT */
          "KP_BLOB" struct {
            uint; /* Address extension of the online data
       (only Low Byte significant) */
            ulong; /* Base address of the online data   */
            ulong; /* Number of Bytes belonging to the online data (1,2 or 4) */
            taggedstruct {
              ("RASTER" uchar)*;
                /* Array of event channel initialization values */
            };
          };
          ("ADDRESS_MAPPING" struct /*lzf 2012.10.30*/
          {
            long;
            long;
            long;
          })*;

        };
      }; /**/
    /end A2ML

    /begin MOD_PAR "_default_ModParComment"
      /begin MEMORY_SEGMENT _RAM
        "calibration_ram"
        DATA
        RAM
        INTERN
        0x40004C00     // 标定量对应在RAM的区域(需将FLASH的标定量复制到这个区)
        0x00002000     // 标定量的大小
        -1 -1 -1 -1 -1
      /end MEMORY_SEGMENT
      /begin MEMORY_SEGMENT _ROM
        "calibration_rom"
        DATA
        FLASH
        INTERN
        0x00008000       // 标定量对应在RAM的区域(需将FLASH的标定量复制到这个区)
        0x00002000       // 标定量的大小
        -1 -1 -1 -1 -1

        /begin IF_DATA ASAP1B_CCP
            ADDRESS_MAPPING /*orig_adr:*/ 0x00008000 /*mapping_adr:*/ 0x40004C00 /*length:*/ 0x2000          // 标定量空间的映射(flash--> ram)
        /end IF_DATA

      /end MEMORY_SEGMENT
      /begin MEMORY_SEGMENT _RAMCAL1
        "measurement_ram"
        DATA
        RAM
        INTERN
        0x40000000   //观测量所在的区域
        0x00004C00
        -1 -1 -1 -1 -1
      /end MEMORY_SEGMENT
      /begin MEMORY_SEGMENT _ECU_CODE1
        ""
        CODE
        FLASH
        INTERN
        0x00020000  // APP的地址
        0x00060000
        -1 -1 -1 -1 -1
      /end MEMORY_SEGMENT
    /end MOD_PAR


    /begin IF_DATA ASAP1B_CCP /* Specific definition for CCP          */


        /begin SOURCE /* Description of a DAQ                 */
          /* (Data Acquisition List)              */
          "5ms" /* Name                                 */
          3 /* Scaling Unit: 1 = 10 us              */
          5 /* Rate in Scaling Unit: 1562           */
          DISPLAY_IDENTIFIER DAQ0
          /begin QP_BLOB /* The QP-BLOB specify the behavior of  */
            /* the corresponding DAQ-List           */
            0 /* Number of DAQ-list                   */
            LENGTH 0x3C /* Number of ODT's, which can be in-    */
              /* serted to this DAQ                   */
            CAN_ID_FIXED 0x300 /* CAN-ID for measuring this DAQ        */
            RASTER 0 /* ECU event-number according to event- */
              /* number by the keyword RASTER.        */
            REDUCTION_ALLOWED /* Data reduction possible              */
            FIRST_PID 0x0 /* First PID for this DAQ               */
          /end QP_BLOB
        /end SOURCE

        /begin SOURCE /* Description of a DAQ                 */
          /* (Data Acquisition List)              */
          "10ms" /* Name                                 */
          3 /* Scaling Unit: 103 = cylinder segment */
          10 /* Rate in Scaling Unit: 1              */
          DISPLAY_IDENTIFIER DAQ1
          /begin QP_BLOB /* The QP-BLOB specify the behavior of  */
            /* the corresponding DAQ-List           */
            1 /* Number of DAQ-list                   */
            LENGTH 0x3c /* Number of ODT's, which can be in-    */
              /* serted to this DAQ                   */
            CAN_ID_FIXED *0x301* /* CAN-ID for measuring this DAQ        */
            RASTER 1 /* ECU event-number according to event- */
              /* number by the keyword RASTER.        */
            REDUCTION_ALLOWED /* Data reduction possible              */
            FIRST_PID 60 /* First PID for this DAQ               */
          /end QP_BLOB
        /end SOURCE
        /begin RASTER /* ECU-event specification              */
          "5ms" /* Name of the ECU-event                */
          "5ms" /* Shortname                            */
          0 /* Number of ECU-event                  */
          3 /* Scaling Unit: 1 = 10 us              */
          5 /* Rate in Scaling Unit: 1562           */
            /* Refresh rate = 1562 * 10us = 15.62ms */
            /* Codes for Scaling units (CSE) look at*/
            /* ASAP1b Specification                 */
        /end RASTER


        /begin RASTER /* ECU-event specification              */
          "10ms " /* Name of the ECU-event                */
          "10ms" /* Shortname                            */
          1 /* Number of ECU-event                  */
          3 /* Scaling Unit: 1 = 10 us              */
          10 /* Rate in Scaling Unit: 391            */
            /* Refresh rate = 391 * 10 us = 3.91ms  */
            /* Codes for Scaling units (CSE) look at*/
            /* ASAP1b Specification                 */
        /end RASTER

        /begin RASTER /* ECU-event specification              */
          "20ms" /* Name of the ECU-event                */
          "20ms" /* Shortname                            */
          2 /* Number of ECU-event                  */
          3 /* Scaling Unit: 3 = 1 ms               */
          20 /* Rate in Scaling Unit: 125            */
            /* Refresh rate = 1 * 125 ms = 125ms    */
            /* Codes for Scaling units (CSE) look at*/
            /* ASAP1b Specification                 */
        /end RASTER

        /begin RASTER /* ECU-event specification              */
          "100ms" /* Name of the ECU-event                */
          "100ms" /* Shortname                            */
          3 /* Number of ECU-event                  */
          3 /* Scaling Unit: 3 = 1 ms               */
          100 /* Rate in Scaling Unit: 125            */
            /* Refresh rate = 1 * 125 ms = 125ms    */
            /* Codes for Scaling units (CSE) look at*/
            /* ASAP1b Specification                 */
        /end RASTER

        /*/begin SEED_KEY
          "D:\seedms6.dll"
          "D:\seedms6.dll"
          "D:\seedms6.dll"
        /end SEED_KEY

        /begin CHECKSUM
          "CRC16.dll"
        /end CHECKSUM*/

        /begin TP_BLOB
          0x0201
          0x0204
          0x111   // 接收报文
          0x112   // 发送报文
          0x0413
          1
          BAUDRATE 500000    // 波特率 500 K
          SAMPLE_POINT 70
          SAMPLE_RATE 1
          BTL_CYCLES 10
          SJW 1
          SYNC_EDGE SINGLE
          DAQ_MODE 0 /* 1 = one DAQ per cycle                   */
          CONSISTENCY 1 /* 1 = ODT consistant                      */
          ADDRESS_EXTENSION 0 /* 0 = 1 extension per DAQ (not supported) */
          RESUME_SUPPORTED /* necessary for ResumeBit support         */
          STORE_SUPPORTED /**/ /* Not supported                           */

          /begin CHECKSUM_PARAM
            0x9001
            0xffffffff
            CHECKSUM_CALCULATION ACTIVE_PAGE
          /end CHECKSUM_PARAM

          /begin DEFINED_PAGES
            2
            "calibration_ram"
            0
            0x40004C00     // 标定量在RAM  ---> 参考区
            0x00002000
            RAM
            RAM_INIT_BY_TOOL
          /end DEFINED_PAGES

          /begin DEFINED_PAGES
            1
            "calibration_rom"  // 标定量在FLASH  ---> 参考区
            0
            0x00008000
            0x00002000
            FLASH
          /end DEFINED_PAGES

          OPTIONAL_CMD 0X5
          OPTIONAL_CMD 0X8
          OPTIONAL_CMD 0X9
          OPTIONAL_CMD 0XC
          OPTIONAL_CMD 0XD
          OPTIONAL_CMD 0XE /**/
          OPTIONAL_CMD 0XF
          OPTIONAL_CMD 0X10
          OPTIONAL_CMD 0X11
          OPTIONAL_CMD 0X12
          OPTIONAL_CMD 0X13
          OPTIONAL_CMD 0X18
          OPTIONAL_CMD 0X19
          OPTIONAL_CMD 0X20
          OPTIONAL_CMD 0X21
          OPTIONAL_CMD 0X22
          OPTIONAL_CMD 0X23

        /end TP_BLOB
    /end IF_DATA

    /begin MOD_COMMON
      "" /* Comment */
      ALIGNMENT_BYTE 1
      ALIGNMENT_WORD 1
      ALIGNMENT_LONG 1
      ALIGNMENT_FLOAT32_IEEE 1
      ALIGNMENT_FLOAT64_IEEE 1
      BYTE_ORDER MSB_FIRST
      DEPOSIT ABSOLUTE
    /end MOD_COMMON
     /begin RECORD_LAYOUT Scalar_BOOLEAN
      FNC_VALUES 1 UBYTE COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Scalar_UBYTE
      FNC_VALUES 1 UBYTE COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Scalar_BYTE
      FNC_VALUES 1 SBYTE COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Scalar_UWORD
      FNC_VALUES 1 UWORD COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Scalar_SWORD
      FNC_VALUES 1 SWORD COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Scalar_ULONG
      FNC_VALUES 1 ULONG COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Scalar_LONG
      FNC_VALUES 1 SLONG COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Scalar_FLOAT32_IEEE
      FNC_VALUES 1 FLOAT32_IEEE COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Scalar_FLOAT64_IEEE
      FNC_VALUES 1 FLOAT64_IEEE COLUMN_DIR DIRECT
    /end RECORD_LAYOUT


    /begin RECORD_LAYOUT Lookup1D_BYTE
      FNC_VALUES 1 SBYTE COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup1D_X_BYTE
      AXIS_PTS_X 1 SBYTE INDEX_INCR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup1D_UBYTE
      FNC_VALUES 1 UBYTE COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup1D_X_UBYTE
      AXIS_PTS_X 1 UBYTE INDEX_INCR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup1D_UWORD
      FNC_VALUES 1 UWORD COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup1D_X_UWORD
      AXIS_PTS_X 1 UWORD INDEX_INCR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup1D_WORD
      FNC_VALUES 1 SWORD COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup1D_X_WORD
      AXIS_PTS_X 1 SWORD INDEX_INCR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup1D_ULONG
      FNC_VALUES 1 ULONG COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup1D_X_ULONG
      AXIS_PTS_X 1 ULONG INDEX_INCR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup1D_SLONG
      FNC_VALUES 1 SLONG COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup1D_X_LONG
      AXIS_PTS_X 1 SLONG INDEX_INCR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup1D_FLOAT32_IEEE
      FNC_VALUES 1 FLOAT32_IEEE COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup1D_X_FLOAT32_IEEE
      AXIS_PTS_X 1 FLOAT32_IEEE INDEX_INCR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup1D_FLOAT64_IEEE
      FNC_VALUES 1 FLOAT64_IEEE COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup1D_X_FLOAT64_IEEE
      AXIS_PTS_X 1 FLOAT64_IEEE INDEX_INCR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup2D_UBYTE
      FNC_VALUES 1 UBYTE COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup2D_X_UBYTE
      AXIS_PTS_X 1 UBYTE INDEX_INCR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup2D_BYTE
      FNC_VALUES 1 SBYTE COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup2D_X_BYTE
      AXIS_PTS_X 1 SBYTE INDEX_INCR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup2D_UWORD
      FNC_VALUES 1 UWORD COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup2D_X_UWORD
      AXIS_PTS_X 1 UWORD INDEX_INCR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup2D_WORD
      FNC_VALUES 1 SWORD COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup2D_X_WORD
      AXIS_PTS_X 1 SWORD INDEX_INCR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup2D_ULONG
      FNC_VALUES 1 ULONG COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup2D_X_ULONG
      AXIS_PTS_X 1 ULONG INDEX_INCR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup2D_LONG
      FNC_VALUES 1 SLONG COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup2D_X_LONG
      AXIS_PTS_X 1 SLONG INDEX_INCR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup2D_FLOAT32_IEEE
      FNC_VALUES 1 FLOAT32_IEEE COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup2D_X_FLOAT32_IEEE
      AXIS_PTS_X 1 FLOAT32_IEEE INDEX_INCR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup2D_FLOAT64_IEEE
      FNC_VALUES 1 FLOAT64_IEEE COLUMN_DIR DIRECT
    /end RECORD_LAYOUT

    /begin RECORD_LAYOUT Lookup2D_X_FLOAT64_IEEE
      AXIS_PTS_X 1 FLOAT64_IEEE INDEX_INCR DIRECT
    /end RECORD_LAYOUT

/end PROJECT



  • 10
    点赞
  • 98
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 10
    评论
C语言文件解析是指对C语言编程中使用的文件进行分析,以便在编译阶段正确地向程序中插入所需的函数和数据类型声明。文件解析通常由词法分析器来完成。 词法分析器是编译器中的一个重要组成部分,用于将源代码分割成一个个词法单元,以便后续分析和处理。在文件解析中,词法分析器主要完成以下任务: 1. 识别和提取文件中的词法单元:词法单元可以是关键字、标识符、运算符、常量或分隔符等。词法分析器通过识别文件中的这些词法单元,将文件分割成一个个独立的部分,便于后续分析。 2. 识别文件中的函数和数据类型声明:词法分析器可以通过判断特定的词法单元组合来确定文件中是否存在函数或数据类型的声明。例如,通过识别关键字 "int" 及其后面的标识符,可以判断出文件中存在一个整型变量的声明。 3. 处理文件中的宏定义和条件编译指令:词法分析器还需要处理文件中的宏定义和条件编译指令。宏定义可以将一组代码或常量定义为一个宏,词法分析器需要将其识别出来,以便编译器在后续处理时正确地进行替换。条件编译指令根据预定义的条件判断是否编译某段代码,词法分析器需要识别这些指令,以确定是否应该编译相关代码。 总的来说,C语言文件解析是通过词法分析器对文件进行识别和拆分,以便编译器在编译阶段能够正确地插入所需的函数和数据类型声明,保证程序的正确性和可执行性。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

qq_34309267

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值