-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data driven parser #26
Conversation
d50e91b
to
04e7ba5
Compare
"in" : (list[Argument], OPT) | ||
}, | ||
|
||
"Property" : { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment in other VSC PR. Is it aligned that properties always are read-write, i.e. no need to include any information concerning that? (The current VSC seat example include a field type
that specifies attribute
, likely inspired by VSS.
properties:
- name: a_property # Will this be acceptable?
description: A signal
type: attribute # or sensor.
datatype: uint8 # Native datatypes only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it aligned that properties always are read-write, i.e. no need to include any information concerning that?
I don't know but it's a question for the VSC definition itself. (Can you create an issue for this question?)
(The current VSC seat example include a field type that specifies attribute, likely inspired by VSS.
Yes I noticed the difference compared to the previous parser but decided to implement following the README (Properties) as closely as I could, since it acts as our specification at the moment. :
Also, if we do #1 it would warn about unexpected stuff appearing in the YAML (e.g. type), which the current parser is not designed to do yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created https://github.com/COVESA/vehicle_service_catalog/issues/30 for the property discussion
04e7ba5
to
b7aa26f
Compare
Rebased on top of #83 (which is also up to date with current master) |
The tests ran on 3.8 and fail because the code now uses the match statement introduced in python 3.9 |
Sorry, python 3.10 is where the match statement was introduced. My mistake. @erikbosch @waltersve @magnusfeuer @ mikahil |
2fa44a7
to
2635ca8
Compare
For me dependencies to a newer Python is no problem as it just concerns tooling (and nothing that shall run inside the vehicle). But don't we need to update e.g. https://github.com/COVESA/vsc-tools/blob/master/Pipfile then as well to require 3.10? I am in favor of merging this one even if not all parts are perfect, to reduce dependencies. I would however like us to briefly discuss the change of properties to remove sensor/attribute/actuator and always consider them as read/write. The change in this PR is aligned with the formal syntax for VSC but not the example - and some of the templates currently use the information. If we all agree that we do not need any information on whether a property is read-only or read-write I am fine. I just want to avoid that we remove it from the templates and one month later realize that we still need it. |
2635ca8
to
b4e71c8
Compare
@@ -12,4 +12,4 @@ pytest = ">=2.7.2" | |||
[dev-packages] | |||
|
|||
[requires] | |||
python_version = "3.8" | |||
python_version = "3.10" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do the lock file also needs to be updated?
ca999df
to
74ca588
Compare
Meeting decision: Ok to merge after pipfile.lock has been updated |
74ca588
to
46ca42b
Compare
Fix inconsistent indentation first to prepare for upcoming changes.
Rewrite of significant core parts of the parser. Instead of explicit classes and explicit readers for each class in the AST, it now has a generic reader function for any "Node", where the behavior is driven by an input data-structure that acts as a schema definition.
Ensure nodes have the right parent node so that the AnyTree hierarchy path is correct. Although it didn't affect most generators, this means AST can be navigated either through navigating the member variables of the AST objects, or by using AnyTree methods to address/search/etc. in the hierarchical path that AnyTree keeps track of.
The latest rewrite introduced language features from python 3.10 Adjust Pipfile / lock, and the GitHub actions test accordingly.
46ca42b
to
80eef29
Compare
This is a completely rewritten parser (and some resulting modifications to generator) that is more "schema-driven". The VSC language is defined with a data structure that is like a "schema" or language definition, and a generic engine is operating on that.