Menu

#1068 Add proper support for time literals and adapter types to new ST parser

1.8
closed-accepted
4DIAC-IDE
Improvement
Normal
2015-11-19
2015-11-17
No
  • Implement Xtext value converters for ST time literals.
  • Add support for adapter types to ST scope provider.
  • Add missing dependencies to plugin manifests.

Note: Please regenerate the Xtext code using the MWE2 workflows after applying the patch.

1 Attachments

Discussion

  • Martin Jobst

    Martin Jobst - 2015-11-18

    Another patch to fix an error with dangling references towards adapter types.

     
  • Monika Wenger

    Monika Wenger - 2015-11-18
    • status: open --> open-accepted
    • Milestone: Backlog --> 1.8
     
  • Monika Wenger

    Monika Wenger - 2015-11-18

    thank you for these patches the fist one is added in cset[fordiac-ide:8f8465] and fixes the timing literals

     

    Related

    Commit: [8f8465]


    Last edit: Monika Wenger 2015-11-18
  • Monika Wenger

    Monika Wenger - 2015-11-18

    the second patch is applied in cset [fordiac-ide:36df40] unfortunately it does not solve the recognition of adapters in st. for Timer.DT:=T#5s; it still shows "missmatched input 'DT' expecting RULE_ID" and for ctrl space it throws an exception:

    Error in polymorphic dispatcher : String index out of range: -1
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(Unknown Source)

     
  • Martin Jobst

    Martin Jobst - 2015-11-19

    The name of the variable you're using 'DT' is a keyword (and thus not a valid identifier). That is why the parser cannot handle it correctly. It actually uses the proposal, but then cannot match it for that rule, that's why you get an exception.

    It seems many blocks use keywords as variable names contrary to the standard.
    I believe we really need to implement proper checking for this in NameRepository.checkReservedKeyWords().
    Of course, we still need to think about fixing existing blocks that have this problem.

     
    • Zoitl Alois

      Zoitl Alois - 2015-11-19

      The problem now is that DT is a variable name used by IEC 61499 standard. So we have a clash of IEC 61131-3 and IEC 61499 here. In the discussion of a similar [issues:#945] we decided to drop the support for the short names of data types for type declarations and allow them only for literals. I think we need to go here the same direction.

       

      Related

      Issues: #945

  • Monika Wenger

    Monika Wenger - 2015-11-19
    • status: open-accepted --> closed-accepted
     
  • Monika Wenger

    Monika Wenger - 2015-11-19

    thanx for the comments, I will then close this issue and open a new one to remove short forms from the data types

     

    Last edit: Monika Wenger 2015-11-19

Log in to post a comment.

Auth0 Logo