Noteringar om syntaxen:   -*- outline -*-

* Grammar: class_definition

Should be

     "=" name [ array_dimensions ] [ class_modification ] )

and not

     "=" IDENT [ array_dimensions ] [ class_modification ] )

Status: fixed

* Redeclare of array elements

This is currently allowed by the grammar, but seems to me to be
obviously wrong.  And it seems that others agree.

	class Foo
	  Int x;
	end;

	class Bar
	  Foo y[10];
	end;

	class Weird
	  Bar z(y[5](redeclare Real x));
	end;

BAD Solution: Change the production rule for element_modification

Previously:

      element_modification :
         [ final ] component_reference modification

New:

      element_modification :
         [ final ] name modification

Trouble: This disallows the following (correct) example:

	class Foo
	  Real x[100];
	end Foo;

	class Bar
	  Foo y(x[17] = 123.0);
	end Bar;

Status: Unresolved. Maybe a semantic rule to prohibit this is needed.

* Double modifiers

The grammar for components are as follows (only the relevant parts are
included here):


       component_clause:
          type_prefix type_specifier component_list

       type_prefix :
          [ flow ] [ parameter | constant ] [ input | output ]

       type_specifier :
          name

       component_list :
          component_declaration { "," component_declaration }

       component_declaration :
          declaration comment

       declaration :
          IDENT [ array_dimensions ] [ modification ]

       modification :
          class_modification
        | "=" expression

        
       class_modification :
          "(" { argument_list } ")"


But the Modelica Standard Library contains code that breaks
this. Namely there are components that contains both types of
modifications simultaneously, as in the following example:

   constant Real         N_A     (final unit="mol-1")
                                 = 6.0221367e23  "Avogadro constant";

Solution: Change the modification rule to something like

       modification :
          class_modification [ "=" expression ]
        | "=" expression

* final

Appendix B.5 contains a note that says that a class declaration can be
prefixed with "final", but that is not described by the grammar.

Suggestion: Change the production rule for class_definition.

      class_definition :
            [ partial | final ] 
         ( class | model | record | block | connector | type |
           package | function ) 
         IDENT comment
         ( composition end IDENT | 
           "=" IDENT [ array_dimensions ] [ class_modification ] )

Status: fixed

* connect

Connect statements in the equation part of a class definition can not
be treated as a function call as the grammar implies. Therefore it
would be more reasonable to make connect() a special construct which
takes two component_references, or even a more restricted for of
component_reference, as the can only be one dot in them (ref. Dag).

  equation :
        ( "connect" "(" component_reference "," component_reference ")"
	  | simple_expression [ ( "=" | ":=" ) expression ] 
          | conditional_equation
          | for_clause
          | while_clause )
        comment

Status: fixed in a similar way

* File name suffix

The file name suffix should be standardized. I have seen both .mdc,
.mod and .mo. I vote for .mdc.

Status: The preferred is ".mo".
