Skip to content
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

GVL uses only the first variable List #32

Open
Philipp1297 opened this issue Dec 19, 2024 · 2 comments
Open

GVL uses only the first variable List #32

Philipp1297 opened this issue Dec 19, 2024 · 2 comments

Comments

@Philipp1297
Copy link

If there are multiple GVL lists inside one GVL-file, then only the first one is parsed.

SCL Example:

{attribute 'qualified_only'}
VAR_GLOBAL CONSTANT
	iMaxUnits : INT := 12;
	
	uiMaxTestBenches : UINT := 4;

	timHeartbeatResetDelay : TIME := T#300MS;
	
	test_2: BOOL;	
END_VAR

VAR_GLOBAL 
	test: BOOL;
END_VAR


VAR_GLOBAL PERSISTENT 
	test123: BOOL;	
	sTesting: STRING;
END_VAR

Documentation Output:
image

I saw that inside the interpreter.py there is only the first variable_list used.

Is there an easy way to fix this?

@RobertoRoos
Copy link
Member

Thanks for the report, good point.

I don't think flags like CONSTANT are processed yet at all, there should be some functionality for that, ideally shared with variable lists in e.g. function blocks.

@Philipp1297
Copy link
Author

Philipp1297 commented Dec 23, 2024

It is processed like its shown inside the .tc file

VariableList:
    CommentAny*
    name=VariableListType
    (constant?='CONSTANT')?
    (persistent?='PERSISTENT')?
    variables*=Variable
    CommentAny*
    // Catch trailing comments here, not at the end of `Variable`
    'END_VAR'
;

But it is skipped in the interpreter.py:

self._model = meta_model.variable_lists[0]

In the other index of the list there is the Constant and Persistent Lists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants