Skip to content

Property set parser: enumeration followed by another property definition fails #125

@avrabe

Description

@avrabe

Summary

When a property set contains an enumeration property definition followed by another property definition, the parser reports spurious errors after the enumeration.

Reproducer

property set Test_Props is
  Radio: enumeration (ThreadMesh, LoRa, BLE) applies to (bus);
  Binding: aadlstring applies to (device);
end Test_Props;
$ spar parse /tmp/test_enum4.aadl
/tmp/test_enum4.aadl:92: expected END_KW
/tmp/test_enum4.aadl:92: expected name
/tmp/test_enum4.aadl:92: expected SEMICOLON
/tmp/test_enum4.aadl:92: expected `package` or `property set`

Works when

  • Enumeration is the last declaration in the property set.
  • Enumeration is the only declaration in the property set.
  • The following declaration is omitted entirely.

Expected

Parses cleanly. The AADL grammar permits multiple property definitions of any mix of types in a property set.

Impact

Had to rewrite wohl_properties.aadl to use aadlstring instead of enumeration for a radio-protocol enum, losing the type-safety the AADL enumeration provides.

Side note

The reported line number (92) does not correspond to the 4-line file — it appears to be a byte offset or token index. Worth fixing separately so error messages point at the right location.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions