Characters (í, á, ã...) : Parser | Complete OCL | UML Models [message #992425] |
Fri, 21 December 2012 10:56  |
Eclipse User |
|
|
|
Hi,
How the OCL libraries for UML and Ecore (i.e. org.eclipse.ocl and org.eclipse.ocl.uml) deal with package and classes names that have withespaces, and most importantly, have characters like "í", "á", "ã" , etc... ?
Related to the package hierarchy, it works ? For instance, writing something like
RootPackage::Package1::Package2::PAckage3::Class1 as a context, or package declaration... i have a parser error... I'm using the Complete OCL Editor with UML models. I know that the name are placed like this: _'ClassName'. But, i still got the parser errors that i mentioned.
I have seen that the 3.2 version (.ocl and .ocl.uml) does not work very well in this cases, also with the hierarchy packages.
Is there correct? And what about the new version of OCL like 4.0 and so on...
I need of this funcionality, i.e. dealing with this kind of caracters and names...
Thank you very much !
John
|
|
|
Re: Characters ( [message #992445 is a reply to message #992425] |
Fri, 21 December 2012 11:36   |
Eclipse User |
|
|
|
Hi
In principle non-ASCII characters are only an issue on input (parsing)
and output (code generation).
Up until OCL 2.3, OCL gave no clue as to how Unicode characters were
supported; they just were.
OCL 2.3 added an underscore-prefix string literal in which standard Java
backslash sequences (other than Octal) may be used; see the OCL spec on
StringLiteral in Clause 9.
This syntax has been supported by Eclipse OCL probably since Indigo;
certainly in Juno.
If you use non-ASCII characters you need to ensure that their encoding
is not corrupted; I recommend setting your project to UTF-8.
As to the parser errors, since you provide no detail or repro, I cannot
comment further.
Regards
Ed Willink
On 21/12/2012 15:56, John G. wrote:
> Hi,
>
> How the OCL libraries for UML and Ecore (i.e. org.eclipse.ocl and
> org.eclipse.ocl.uml) deal with package and classes names that have
> withespaces, and most importantly, have characters like "í", "á", "ã"
> , etc... ?
> Related to the package hierarchy, it works ? For instance, writing
> something like
> RootPackage::Package1::Package2::PAckage3::Class1 as a context, or
> package declaration... i have a parser error... I'm using the Complete
> OCL Editor with UML models. I know that the name are placed like this:
> _'ClassName'. But, i still got the parser errors that i mentioned.
>
> I have seen that the 3.2 version (.ocl and .ocl.uml) does not work
> very well in this cases, also with the hierarchy packages.
>
> Is there correct? And what about the new version of OCL like 4.0 and
> so on...
>
> I need of this funcionality, i.e. dealing with this kind of caracters
> and names...
>
> Thank you very much !
>
> John
>
|
|
|
|
Re: Characters ( [message #992474 is a reply to message #992463] |
Fri, 21 December 2012 13:32  |
Eclipse User |
|
|
|
Hi
Could be as you think. Did you try UTF-8.
I need a zipped project, rather than a file and cut and paste to ensure
that I am able to reproduce your usage.
Regards
Ed Willink
On 21/12/2012 17:49, John G. wrote:
> My constraint:
>
>
> import 'platform:/resource/Myproject/model/teste.uml'
>
> package EA_Model
>
> context _'PessoaFÃsica'
> inv teste: self.RG> 0
>
> endpackage
>
>
>
> I think that this error is due to the context _'PessoaFÃsica'
>
>
>
> java.lang.IllegalArgumentException: The 'no null' constraint is violated
> at org.eclipse.emf.common.util.AbstractEList.validate(AbstractEList.java:95)
> at org.eclipse.emf.ecore.util.EcoreEList.validate(EcoreEList.java:63)
> at org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList.java:418)
> at org.eclipse.emf.common.notify.impl.NotifyingListImpl.doAddUnique(NotifyingListImpl.java:325)
> at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:282)
> at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:301)
> at org.eclipse.ocl.uml.internal.UMLReflectionImpl.addConstrainedElement(UMLReflectionImpl.java:523)
> at org.eclipse.ocl.uml.internal.UMLReflectionImpl.addConstrainedElement(UMLReflectionImpl.java:1)
> at org.eclipse.ocl.parser.AbstractOCLAnalyzer.invCS(AbstractOCLAnalyzer.java:1451)
> at org.eclipse.ocl.parser.AbstractOCLAnalyzer.invOrDefCS(AbstractOCLAnalyzer.java:1419)
> at org.eclipse.ocl.parser.AbstractOCLAnalyzer.classifierContextDeclCS(AbstractOCLAnalyzer.java:1371)
> at org.eclipse.ocl.parser.AbstractOCLAnalyzer.contextDeclCS(AbstractOCLAnalyzer.java:777)
> at org.eclipse.ocl.parser.AbstractOCLAnalyzer.packageDeclarationCS(AbstractOCLAnalyzer.java:736)
> at org.eclipse.ocl.parser.AbstractOCLAnalyzer.packageDeclarationCS(AbstractOCLAnalyzer.java:752)
> at org.eclipse.ocl.parser.AbstractOCLAnalyzer.documentCS(AbstractOCLAnalyzer.java:674)
> at org.eclipse.ocl.parser.OCLAnalyzer.parseOCLDocument(OCLAnalyzer.java:215)
> at org.eclipse.ocl.OCL.parse(OCL.java:305)
> at br.ufes.inf.nemo.ocl2alloy.parser.OCLParser.<init>(OCLParser.java:151)
> at br.ufes.inf.nemo.ocl2alloy.parser.OCLParser.main(OCLParser.java:196)
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.33169 seconds