osate / osate2

Open Source AADL2 Tool Environment
http://osate.org
Eclipse Public License 2.0
39 stars 8 forks source link

Part of package is being skipped/omitted #1895

Closed stevevestal closed 5 years ago

stevevestal commented 5 years ago

Summary

When I open the following in the editor, the Outline view only shows declarations down through System.Refine2. System.Refine3 and System.Refine4 are shown in the editor but do not appear in the Outline. No errors are reported. Is there any way to attempt an instantiation other than from the outline?

Expected and Current Behavior

Expected to see all package elements in the Outline. If errors exist, expected to see them reported and expected to still see all package elements in the Outline.

Steps to Reproduce

-- Illustrates several cases of connection refinements that currently
-- generate errors in OSATE2 but seem very useful and in at least one
-- case possibly legal.

-- The one in system implementation Sys.Refine2 might be an OSATE2
-- bug, or it might be that the standard is unclear about what is
-- legal.  (This error message masks subsequent error messages,
-- some commenting-out of previous errors is needed to see subsequent
-- error messages.)

-- The others are reasonably or clearly illegal in the current AADL
-- standard, but they seem like errata (things that are meaningful
-- and desirable in use).

package RefineConnect
public

    system SysPort
        features
            outp: out data port;
            inp: in data port;
    end SysPort;

    feature group FG
    end FG;

    system SysGroup
        features
            outg: feature group FG;
            ing: feature group inverse of FG;
    end SysGroup;

    system Sys
    end Sys;

    system implementation Sys.Parent
    subcomponents
        sysAP: system SysPort;
        sysBP: system SysPort;
        sysAG: system SysGroup;
        sysBG: system SysGroup;
    connections
        c_abp: port sysAP.outp -> sysBP.inp;
        c_abg: feature group sysAG.outg <-> sysBG.ing;
    end Sys.Parent;

    system implementation Sys.Child extends Sys.Parent
    subcomponents
        sysCP: system SysPort;
        sysCG: system SysGroup;
    end Sys.Child;

    system implementation Sys.Refine1 extends Sys.Child
        connections
            -- Accepted by OSATE2
            c_abp: refined to port {Latency => 200ms .. 200ms;};
    end Sys.Refine1;

    system implementation Sys.Refine2 extends Sys.Child
        connections
            -- Standard grammar seems to rule this out,
            -- but the standard text refers to including
            -- source and destination elements.  This may
            -- be an inconsistency in the standard or an
            -- OSATE bug.
            c_abp: refined to port sysAP.outp <-> sysBP.inp;
    end Sys.Refine2;

-- The above error masks error reports in the following
-- declarations.  To see the additional errors, comment
-- out the preceding declarations that generated errors.

    system implementation Sys.Refine3 extends Sys.Child
        connections
            -- I couldn't find anything in the standard forbidding
            -- this, and this form of refinement (to
            -- change one end of the connection) is highly
            -- desirable in practice.  If the standard
            -- forbids this, that should be an errata.
            c_abp: refined to port sysAP.outp -> sysCP.inp;
    end Sys.Refine3;

    system implementation Sys.Refine4 extends Sys.Child
        connections
            -- The standard explicitly forbids this for
            -- feature group connections, but it is
            -- as desirable and meaningful as the port
            -- refinement above.  There should also be as
            -- much symmetry as possible between port connections
            -- and feature group connections. This should
            -- be an errata.
            c_abg: refined to port sysAG.outg <-> sysCG.ing;
    end Sys.Refine4;    

end RefineConnect;

Environment

lwrage commented 5 years ago

Parts of the file are skipped because the parser sees a syntax error in Sys.Refine2 from which it can't recover. There's not much we can do about that.

lwrage commented 5 years ago

I had a look at the standard. I agree that the grammar is inconsistent with the written text. The grammar allows only properties and modes to be added, which is implemented in OSATE. The text seems to allow source and destination, too. The text also talks refining bidirectional feature connections to unidirectional port connections, which obviously would require the -> symbol in the refinement. I suggest you file this as an issue in the language issue tracker at https://github.com/saeaadl/aadlv2.2/issues as it's clearly a problem in the standard.

stevevestal commented 5 years ago

I knew it contained things that OSATE previously complained about. What I considered an error is that it did not report any errors to me, no error markers.

lwrage commented 5 years ago

I can't reproduce that. I see the syntax error marker in the text editor in 2.5.1 for the first syntax error. After that the parser continues to expect the end of the package. Following input is ignored. Please test in 2.5.0 or the 2.5.1 release candidate.

lwrage commented 5 years ago

@stevevestal Can you reproduce the issue in OSATE 2.5.1?

stevevestal commented 5 years ago

In the current OSATE 2.5.1 Product build I see the errors in both the problems view and the editor view, and the editor view shows the complete package. Closing as cannot reproduce.