Allow grammars without root node

Issue #147 resolved
Jesper Öqvist created an issue

JastAdd complains if there is no "root" node in the grammar:

  [jastadd] generating node types and weaving aspects
  [jastadd] Error: No root node available

We can remove this error since root nodes only affect collection attributes. The only thing we need to change is that collection attributes must check if there is a default root node - if not it should be explicitly declared in the collection declaration.

Comments (2)

  1. Jesper Öqvist reporter

    A root node is any ASTDecl for which isRootNode is true.

      eq ASTDecl.isRootNode() =
        !hasAbstract() &&
        !isASTNodeDecl() &&
        !isOptDecl() &&
        !isListDecl() &&
        parents().isEmpty();
    
  2. Log in to comment