Skip to content

Commit ff934b6

Browse files
committed
Fixed missing CONTROLLER_ADDRESS tag (#6)
1 parent 45073d9 commit ff934b6

File tree

14 files changed

+4504
-4397
lines changed

14 files changed

+4504
-4397
lines changed

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ option(BUILD_SHARED_LIBS "Static libraries are preferred" OFF)
1313
option(A2L_DOC "If doxygen is installed, then build documentation in Release mode" OFF)
1414
option(A2L_TOOLS "Building applications" OFF)
1515
option(A2L_TEST "Building unit test" OFF)
16-
option(A2L_LEX "Create LEX/BISON" OFF)
16+
option(A2L_FLEX "Create FLEX/BISON files" OFF)
1717

1818
if(A2L_TOOLS AND USE_VCPKG)
1919
list(APPEND VCPKG_MANIFEST_FEATURES "tools")
@@ -41,12 +41,12 @@ if (A2L_DOC)
4141
include(script/doxygen.cmake)
4242
endif()
4343

44-
if (A2L_LEX)
44+
if (A2L_FLEX)
4545
include(script/flex.cmake)
4646
include(script/bison.cmake)
4747
endif()
4848

49-
if (BISON_FOUND AND A2L_LEX)
49+
if (BISON_FOUND AND A2L_FLEX)
5050
BISON_TARGET(A2L_PARSER src/a2lparser.y ${CMAKE_CURRENT_SOURCE_DIR}/src/a2lparser.cpp
5151
COMPILE_FLAGS "")
5252
cmake_print_variables(BISON_A2L_PARSER_DEFINED
@@ -79,7 +79,7 @@ if (BISON_FOUND AND A2L_LEX)
7979

8080
endif ()
8181

82-
if (FLEX_FOUND AND A2L_LEX)
82+
if (FLEX_FOUND AND A2L_FLEX)
8383
FLEX_TARGET(A2L_SCANNER src/a2lflexer.l ${CMAKE_CURRENT_SOURCE_DIR}/src/a2lflexer.cpp)
8484
cmake_print_variables(FLEX_A2L_SCANNER_DEFINED
8585
FLEX_A2L_SCANNER_OUTPUTS

include/a2l/a2lstructs.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,18 @@ struct A2lCalibrationHandle {
6363

6464
struct A2lCalibrationMethod {
6565
std::string Method;
66-
uint64_t Version;
66+
uint64_t Version = 0;
6767
std::vector<A2lCalibrationHandle> CalibrationHandleList;
6868
};
6969

70+
struct A2lControllerAddress {
71+
uint64_t Index = 0;
72+
A2lByteOrder ByteOrder = A2lByteOrder::MSB_LAST;
73+
uint64_t StartAddress = 0;
74+
uint64_t Length = 0;
75+
};
76+
using ControllerAddressList = std::vector<A2lControllerAddress>;
77+
7078
struct A2lDependentCharacteristic {
7179
std::string Formula;
7280
std::vector<std::string> CharacteristicList;

include/a2l/module.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ class Module : public A2lObject {
9898
}
9999
[[nodiscard]] CompuVtabRange* GetCompuVtabRange(const std::string& name);
100100

101+
void AddControllerAddress(A2lControllerAddress controller_address) {
102+
controller_address_list_.emplace_back(controller_address);
103+
}
104+
[[nodiscard]] ControllerAddressList& ControllerAddresses() {
105+
return controller_address_list_;
106+
}
107+
[[nodiscard]] const ControllerAddressList& ControllerAddresses() const {
108+
return controller_address_list_;
109+
}
110+
101111
void AddFrame(std::unique_ptr<Frame>& frame);
102112
[[nodiscard]] FrameList& Frames() {
103113
return frame_list_;
@@ -216,8 +226,6 @@ class Module : public A2lObject {
216226
return user_right_list_;
217227
}
218228

219-
220-
221229
private:
222230
A2lModCommon mod_common_ = {};
223231
A2lModPar mod_par_ = {};
@@ -230,6 +238,7 @@ class Module : public A2lObject {
230238
CompuTabList compu_tab_list_;
231239
CompuVtabList compu_vtab_list_;
232240
CompuVtabRangeList compu_vtab_range_list_;
241+
ControllerAddressList controller_address_list_;
233242
FrameList frame_list_;
234243
FuncList function_list_;
235244
GroupList group_list_;

src/a2lflexer.cpp

Lines changed: 1249 additions & 1237 deletions
Large diffs are not rendered by default.

src/a2lflexer.l

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ keyword [A-Z_0-9]+
8787
"COMPU_VTAB" { return token::COMPU_VTAB; }
8888
"COMPU_VTAB_RANGE" { return token::COMPU_VTAB_RANGE; }
8989
"CONSISTENT_EXCHANGE" { return token::CONSISTENT_EXCHANGE; }
90+
"CONTROLLER_ADDRESSES" { return token::CONTROLLER_ADDRESSES; }
9091
"CONVERSION" { return token::CONVERSION; }
9192
"CPU_TYPE" { return token::CPU_TYPE; }
9293
"CURVE_AXIS_REF" { return token::CURVE_AXIS_REF; }

0 commit comments

Comments
 (0)