Skip to content

Commit

Permalink
Fixed missing CONTROLLER_ADDRESS tag (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
ihedvall committed Jul 13, 2024
1 parent 45073d9 commit ff934b6
Show file tree
Hide file tree
Showing 14 changed files with 4,504 additions and 4,397 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ option(BUILD_SHARED_LIBS "Static libraries are preferred" OFF)
option(A2L_DOC "If doxygen is installed, then build documentation in Release mode" OFF)
option(A2L_TOOLS "Building applications" OFF)
option(A2L_TEST "Building unit test" OFF)
option(A2L_LEX "Create LEX/BISON" OFF)
option(A2L_FLEX "Create FLEX/BISON files" OFF)

if(A2L_TOOLS AND USE_VCPKG)
list(APPEND VCPKG_MANIFEST_FEATURES "tools")
Expand Down Expand Up @@ -41,12 +41,12 @@ if (A2L_DOC)
include(script/doxygen.cmake)
endif()

if (A2L_LEX)
if (A2L_FLEX)
include(script/flex.cmake)
include(script/bison.cmake)
endif()

if (BISON_FOUND AND A2L_LEX)
if (BISON_FOUND AND A2L_FLEX)
BISON_TARGET(A2L_PARSER src/a2lparser.y ${CMAKE_CURRENT_SOURCE_DIR}/src/a2lparser.cpp
COMPILE_FLAGS "")
cmake_print_variables(BISON_A2L_PARSER_DEFINED
Expand Down Expand Up @@ -79,7 +79,7 @@ if (BISON_FOUND AND A2L_LEX)

endif ()

if (FLEX_FOUND AND A2L_LEX)
if (FLEX_FOUND AND A2L_FLEX)
FLEX_TARGET(A2L_SCANNER src/a2lflexer.l ${CMAKE_CURRENT_SOURCE_DIR}/src/a2lflexer.cpp)
cmake_print_variables(FLEX_A2L_SCANNER_DEFINED
FLEX_A2L_SCANNER_OUTPUTS
Expand Down
10 changes: 9 additions & 1 deletion include/a2l/a2lstructs.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,18 @@ struct A2lCalibrationHandle {

struct A2lCalibrationMethod {
std::string Method;
uint64_t Version;
uint64_t Version = 0;
std::vector<A2lCalibrationHandle> CalibrationHandleList;
};

struct A2lControllerAddress {
uint64_t Index = 0;
A2lByteOrder ByteOrder = A2lByteOrder::MSB_LAST;
uint64_t StartAddress = 0;
uint64_t Length = 0;
};
using ControllerAddressList = std::vector<A2lControllerAddress>;

struct A2lDependentCharacteristic {
std::string Formula;
std::vector<std::string> CharacteristicList;
Expand Down
13 changes: 11 additions & 2 deletions include/a2l/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@ class Module : public A2lObject {
}
[[nodiscard]] CompuVtabRange* GetCompuVtabRange(const std::string& name);

void AddControllerAddress(A2lControllerAddress controller_address) {
controller_address_list_.emplace_back(controller_address);
}
[[nodiscard]] ControllerAddressList& ControllerAddresses() {
return controller_address_list_;
}
[[nodiscard]] const ControllerAddressList& ControllerAddresses() const {
return controller_address_list_;
}

void AddFrame(std::unique_ptr<Frame>& frame);
[[nodiscard]] FrameList& Frames() {
return frame_list_;
Expand Down Expand Up @@ -216,8 +226,6 @@ class Module : public A2lObject {
return user_right_list_;
}



private:
A2lModCommon mod_common_ = {};
A2lModPar mod_par_ = {};
Expand All @@ -230,6 +238,7 @@ class Module : public A2lObject {
CompuTabList compu_tab_list_;
CompuVtabList compu_vtab_list_;
CompuVtabRangeList compu_vtab_range_list_;
ControllerAddressList controller_address_list_;
FrameList frame_list_;
FuncList function_list_;
GroupList group_list_;
Expand Down
2,486 changes: 1,249 additions & 1,237 deletions src/a2lflexer.cpp

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/a2lflexer.l
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ keyword [A-Z_0-9]+
"COMPU_VTAB" { return token::COMPU_VTAB; }
"COMPU_VTAB_RANGE" { return token::COMPU_VTAB_RANGE; }
"CONSISTENT_EXCHANGE" { return token::CONSISTENT_EXCHANGE; }
"CONTROLLER_ADDRESSES" { return token::CONTROLLER_ADDRESSES; }
"CONVERSION" { return token::CONVERSION; }
"CPU_TYPE" { return token::CPU_TYPE; }
"CURVE_AXIS_REF" { return token::CURVE_AXIS_REF; }
Expand Down
Loading

0 comments on commit ff934b6

Please sign in to comment.