Add ST Grammar#1
Draft
simoes-tiobe wants to merge 5 commits into
Draft
Conversation
Several places where the IEC grammar reduces a bare identifier through multiple aliased or overlapping rules (type vs. function-block names, derived type-name variants, access-path segments) are genuinely ambiguous from syntax alone - which one applies is only decidable with a symbol table - so those spots are collapsed onto the existing shared `type_name`/`symbolic_variable` rules instead, deferring the distinction to a later semantic pass. Other conflicts are fixed more locally: - signed_integer/real_literal fold their optional sign into the token regex so tree-sitter's longest-match lexing picks them over a bare unary-minus operator. - bit_string_literal requires its type prefix, since an unprefixed integer was ambiguous with a plain integer literal. - character_string (used where no STRING/WSTRING keyword disambiguates) is now a single unaliased rule instead of a single-vs-double-byte choice that shared the same delimiter and representation set. - param_assignment's `NOT var_name => var` vs. unary_operator's `NOT expr` is a genuine local ambiguity (resolvable with more lookahead, not by restructuring), so it's handed to GLR via `%conflicts`. Also drops fb_name_decl, made dead by the type_name consolidation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add ST Grammar