simonjwright / coldframe

ColdFrame generates Ada framework code and documentation from UML models.
https://simonjwright.github.io/coldframe
GNU General Public License v2.0
8 stars 1 forks source link

Problem with generalisations #6

Closed AlexProudfoot closed 3 years ago

AlexProudfoot commented 3 years ago

This is really odd because I have other models with generalisation which don't show this problem. The make process fails with a CONSTRAINT_ERROR.

alex@mint-vm$ make
# XXX This is a workround for ArgoUML Issue 6385.
(grep -q "xmlns:argouml" Air_Traffic_Control.uml && cp Air_Traffic_Control.uml /home/alex/coldframe/coldframeout/Air_Traffic_Control.rr~1) ||       \
sed                             \
  -e "s;<pgml ;<pgml xmlns:argouml='http://argouml.org' ;"  \
  <Air_Traffic_Control.uml                          \
  >/home/alex/coldframe/coldframeout/Air_Traffic_Control.rr~1
java -cp /home/alex/saxon/saxon.jar com.icl.saxon.StyleSheet              \
  /home/alex/coldframe/coldframeout/Air_Traffic_Control.rr~1              \
  /home/alex/coldframe/scripts/resolve-references.xsl         \
  library_path=/home/alex/coldframe/lib/              \
  >/home/alex/coldframe/coldframeout/Air_Traffic_Control.rr~2             \
  || (echo "Resolution problem."; rm -f -f /home/alex/coldframe/coldframeout/Air_Traffic_Control.rr /home/alex/coldframe/coldframeout/Air_Traffic_Control.rr~?; exit 1)
# XXX This is a workround for an XML/Ada issue.
sed                             \
  -e "s;org.omg.xmi.namespace.UML;http://www.omg.org/spec/XMI;" \
  </home/alex/coldframe/coldframeout/Air_Traffic_Control.rr~2           \
  >/home/alex/coldframe/coldframeout/Air_Traffic_Control.rr
/home/alex/coldframe/tools/normalize_xmi    \
  -c /home/alex/coldframe/scripts/emacs_case_exceptions \
            \
  /home/alex/coldframe/coldframeout/Air_Traffic_Control.rr
Reading case exceptions from '/home/alex/coldframe/scripts/emacs_case_exceptions'
Processing /home/alex/coldframe/coldframeout/Air_Traffic_Control.rr
raised CONSTRAINT_ERROR : normalize_xmi-model-generalizations.adb:114 access check failed
Call stack traceback locations:
0x4b6dce 0x4eb3e9 0x4ae0c3 0x42f46b 0x43141b 0x7f607987fbf5 0x42e828 0xfffffffffffffffe

/home/alex/coldframe/Makefile.inc:191: recipe for target 'Air_Traffic_Control.norm-stamp' failed
make: *** [Air_Traffic_Control.norm-stamp] Error 1
rm /home/alex/coldframe/coldframeout/Air_Traffic_Control.rr
alex@mint-vm$ 

Here is the makefile.

MODELS = .
include $(COLDFRAME)/Makefile.inc

all: \
 test_atc

test_atc: Air_Traffic_Control.gen Air_Traffic_Control.impl Air_Traffic_Control.test/test_atc.adb
    - gnatmake -p -P Air_Traffic_Control

# ArgoUML support

NORM_FILES = \
 Air_Traffic_Control.norm

# NB! the ';' at the end is important - without it, Make may not know
# to rebuild the .gen directories.
$(NORM_FILES): Air_Traffic_Control.norm-stamp ;

clean:
    rm -rf *.gen
    rm -f *.norm
    rm -f *.norm-stamp
    rm -rf .build
    rm -f Air_Traffic_Control.test/test_atc

And here is the model. Screenshot from 2021-03-09 11-24-44

Air Traffic Control.zip

AlexProudfoot commented 3 years ago

Oh bugger! It's the naming of the classes, isn't it. Must use underscores instead of spaces.

simonjwright commented 3 years ago

Well, yes, but if this was GCC it’d be an Internal Compiler Error (ICE) which Should Not Happen. Will think on.

Also: there’s nothing said about this here, and the section on Inheritance actually shows names with spaces ...

AlexProudfoot commented 3 years ago

Ok. I’ll reopen this then since it’s at least a documentation issue. Thanks for the feedback Simon.

simonjwright commented 3 years ago

It’s now OK to have mixed space(s) and underscore(s) in names! so Air Traffic_ _Controller is correctly translated to Air_Traffic_Controller.