softlang / megalib

A library of megamodels
6 stars 5 forks source link

Make use of links #7

Closed rlaemmel closed 8 years ago

rlaemmel commented 8 years ago

/cc @MarcelH91 @AndrEm12

In the JavaC example, it would make sense to start using links.

DerMusicus commented 8 years ago

what do you mean by saying "start using links"?

rlaemmel commented 8 years ago

3.2 The principle ‘Semantic annotations’ http://softlang.uni-koblenz.de/megaconnect/

image

Basically attach links to everything as much as possible. (When I was checking your stuff, I didn't see any links yet.)

DerMusicus commented 8 years ago

There are links defined in the grammar, they are named descriptions. but i will rename it, because its confusing

rlaemmel commented 8 years ago

What I meant by "Make use of links" -- just starting making use of them in the examples :-)

DerMusicus commented 8 years ago

Oh i see :D

it's wip now ;)

DerMusicus commented 8 years ago

maybe someone, who is expert in writing regular expressions could give me a matching rule for antlr to resolve links

le-cram commented 8 years ago

The problem is that you'd have to write a matching regular expression for any URL. The regex for this would be too complex for my taste to put into an ANTLR grammar. Instead you can solve this by opening a connection to the url. This way you can also check whether the URL links to an existing web resource. http://stackoverflow.com/questions/1378199/how-to-check-if-a-url-exists-or-returns-404-with-java.

aemmerichs commented 8 years ago

I think that we could implement the url check very well in the standard checker, but there still exists the problem, that ANTLR is reading our Megamodel completly, so that we need any Lexer/Parser rule for the url, because otherwise it would throw an exception, if I had understand ANTLR right.

I thought that we could simply allow "everything" as an input at the link in the grammar and as said before, the checker proves later, if it is a link.

le-cram commented 8 years ago

Yes, from here on I take over. I'm already working at it. :-)