kallemooo / asap2 Goto Github PK
View Code? Open in Web Editor NEWAsap2 parser.
License: MIT License
Asap2 parser.
License: MIT License
I want to know how to use this library and function in this library to parse asap2(a2l) ?
Could you share me some reference about the Asap2 library to use it ?
Hi friend. CR4-642.a2l can not parse. have errors . File: https://file.io/dBreoDfQLeDz
The grammar is identifying the RESERVED PrgType as token which makes the parser fail.
E.x.: (I renamed the segment name and description)
/begin MEMORY_SEGMENT nameofsegment "description" RESERVED
The error from the library:
… Line: 926 : Row: 66 : Syntax error, unexpected RESERVED, expecting IDENTIFIER
Hello, I use Asap2 to parse a v1.7 a2l file, it report error when meet MATRIX_DIM like this:
MATRIX_DIM 1 200
I have check the specification, the MATRIX_DIM have fix 3 member x,y,z in v1.6, but v1.7 define like this:
MATRIX_DIM (uint Dim)+
The count of Dim can be 1,2,3,......
So I change my local project, in file Asap2.Language.grammar.y line 1194-1197 change to
matrix_dim : MATRIX_DIM NUMBER {
$$ = new MATRIX_DIM(@$, (uint)$2);
}
;
matrix_dim : MATRIX_DIM NUMBER NUMBER {
$$ = new MATRIX_DIM(@$, (uint)$2, (uint)$3);
}
;
matrix_dim : MATRIX_DIM NUMBER NUMBER NUMBER {
$$ = new MATRIX_DIM(@$, (uint)$2, (uint)$3, (uint)$4);
}
;
And class MATRIX_DIM in file Asap2File.cs change to
[Base(IsSimple = true)]
public class MATRIX_DIM : Asap2Base
{
public MATRIX_DIM(Location location, uint xDim, uint yDim, uint zDim) : base(location)
{
_Dims.Add(xDim);
_Dims.Add(yDim);
_Dims.Add(zDim);
Dims_str = xDim.ToString() + " " + yDim.ToString() + " " + zDim.ToString();
}
public MATRIX_DIM(Location location, uint xDim, uint yDim) : base(location)
{
_Dims.Add(xDim);
_Dims.Add(yDim);
Dims_str = xDim.ToString() + " " + yDim.ToString();
}
public MATRIX_DIM(Location location, uint xDim) : base(location)
{
_Dims.Add(xDim);
Dims_str = xDim.ToString();
}
[Element(0, IsArgument = true)]
public string Dims_str = "";
public List _Dims = new List();
}
Now it work for my a2l file, but the count of MATRIX_DIM is limit to 3, is there a better solution?
What is the license for the code in this project?
https://help.github.com/articles/adding-a-license-to-a-repository/
I think the MIT License is a good choice.
/begin CHARACTERISTIC DATA_AsdDsbcCtl.AsdDsbcCtl_tiFil_nGrd_C_VW.At_Fnt
"time constant for speed gradient"
VALUE
0xa086e5b2
_REC_S1VAL_20_U1
2.54
_CNV_R_R_gqBeevc_jq_228_CM
1.e-002
2.55
DISPLAY_IDENTIFIER AsdDsbcCtl_tiFil_nGrd_C_VW.At_Fnt
FORMAT "%6.2"
/begin IF_DATA ETK
DP_BLOB
0xa086e5b2
1
/end IF_DATA
/end CHARACTERISTIC
The parser does not like the "1.e-002".
Syntax error, unexpected IDENTIFIER, expecting NUMBER
@kallemooo There is a package on NuGet that references this repository, but appears to be published by someone else?
https://www.nuget.org/packages/Asap2/
If it's you, then update the readme, if not, contact the publisher and get the package re-assigned to this you and/or publish your own package.
Hi:
Thanks for you lib!
I found software crash when a2l include following txt:
/begin RECORD_LAYOUT SWORD_COL_DIRECT
FNC_VALUES 1 SWORD COLUMN_DIR DIRECT
ALIGNMENT_WORD 2
ALIGNMENT_LONG 2
ALIGNMENT_FLOAT32_IEEE 2
ALIGNMENT_FLOAT64_IEEE 4
/end RECORD_LAYOUT
It seems the problem come from Asap2Files.cs line 816
[Element(1, IsDictionary = true)]
public Dictionary<string, ALIGNMENT> alignments;
So I change it to :
[Element(1, IsDictionary = true)]
public Dictionary<string, ALIGNMENT> alignments = new Dictionary<string, ALIGNMENT>();
The software can work normally now. Is my modification correct?
I tried this A2L parsing utility on one of my A2L's, and it errored out, stating that an IF_DATA keyword was unexpected in an AXIS_PTS. I believe this is valid A2L syntax per ASAM MCD-2 MC. See https://www.asam.net/standards/detail/mcd-2-mc/wiki/.
I am pretty new to LEX/YACC, but i think maybe the error is on line 498 of Asap2.Language.grammar.y?
| axis_pts if_data {
should be
| axis_pts_data if_data {
Maybe?
Otherwise this is an awesome tool - thanks for making it available!
Hi!
First of all, great Lib!
Do you have plans to update the code base to support current A2L specification 1.7.1?
There were some changes, see at the bottom of the site (Release Presentation):
https://www.asam.net/standards/detail/mcd-2-mc/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.