Menu

#3 can't define required grammar, please help

open
nobody
None
5
2013-01-30
2010-10-12
Nahid
No

Hi,
I want to validate Ontex syntax which is used to write OWL axiom. Say, I have following 2 axioms:

1. Address(CIAO2010, \string{Via Sommarive, 18 - 38123 Povo di Trento (ITALY)})
2. \oalldiff{ CIAO2010, ESWC2010, IWC2010}

And my parser definition is:

'[A-Za-z0-9\_\#\&\;\+\:\-]+' NAME
'\{([^\}])*\}' ANYTHING_IN_CURLY
'\\integer|\\string|\\boolean|\\float|\\dateTime' DATATYPES
"\\oalldiff" ALLDIFFERENT

datatypeassertion: NAME '(' NAME , DATATYPES ANYTHING_IN_CURLY ')'
;

objectSequenceIdentity: ALLDIFFERENT '\{' NAME oneOrMoreNames '\}'
;

oneOrMoreNames: ',' NAME | ',' NAME oneOrMoreNames
;

But it doesn't work.
Because the pattern for '\{([^\}])*\}' ANYTHING_IN_CURLY also matched with ALLDIFFERENT '\{' NAME oneOrMoreNames '\}' ({ CIAO2010, ESWC2010, IWC2010}).

Is this problem clear?
How can I define the parser to full-fill my need?

Please help me.
thanks
-Nahid

Discussion


Log in to post a comment.