Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Anders Nilsson
OwlCompiler
Commits
54c2b20f
Commit
54c2b20f
authored
Feb 26, 2007
by
Anders Nilsson
Browse files
Modified StringElement so that it can handle also strings with double quotes (") within
parent
0c656895
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
owl.ast
View file @
54c2b20f
...
...
@@ -48,9 +48,9 @@ OwlRestriction : ComplexElement;
OwlUnionOf : ComplexElement;
abstract SimpleElement : Element;
StringElement : SimpleElement ::= <
IDENTIFIER
>;
IntElement : SimpleElement ::= <
INTEGER_
LITERAL>;
FloatElement : SimpleElement ::= <
FLOAT_
LITERAL>;
StringElement : SimpleElement ::= <
LITERAL
>;
IntElement : SimpleElement ::= <LITERAL>;
FloatElement : SimpleElement ::= <LITERAL>;
abstract Attribute ::= Value;
Version : Attribute;
...
...
owl.jjt
View file @
54c2b20f
...
...
@@ -196,7 +196,11 @@ SPECIAL_TOKEN : /* COMMENTS */
"\u3300"
-
"\u337f"
,
"\u3400"
-
"\u3d2d"
,
"\u4e00"
-
"\u9fff"
,
"\uf900"
-
"\ufaff"
"\uf900"
-
"\ufaff"
,
"+"
,
"-"
,
","
,
"."
]
>
|
...
...
@@ -230,14 +234,17 @@ SPECIAL_TOKEN : /* COMMENTS */
|
<
LBRACKET
:
"["
>
|
<
RBRACKET
:
"]"
>
|
<
SEMICOLON
:
";"
>
|
<
COMMA
:
","
>
|
<
DOT
:
"."
>
|
<
QUOTE
:
"
\"
"
>
//
|
<
COMMA
:
","
>
//
|
<
DOT
:
"."
>
}//
SEPARATORS
<
DEFAULT
,
BOUNDS
>
TOKEN
:
/*
OPERATORS
*/
{
<
ASSIGN
:
"="
>
<
ASSIGN
:
"="
>
|
<
START_ENDTAG
:
"</"
>
|
<
START_TAG
:
"<"
>
//
|
<
GT
:
">"
>
//
|
<
LT
:
"<"
>
//
|
<
BANG
:
"!"
>
...
...
@@ -252,8 +259,8 @@ SPECIAL_TOKEN : /* COMMENTS */
//
|
<
SC_AND
:
"&&"
>
//
|
<
INCR
:
"++"
>
//
|
<
DECR
:
"--"
>
|
<
PLUS
:
"+"
>
|
<
MINUS
:
"-"
>
//
|
<
PLUS
:
"+"
>
//
|
<
MINUS
:
"-"
>
//
|
<
STAR
:
"*"
>
|
<
SLASH
:
"/"
>
//
|
<
BIT_AND
:
"&"
>
...
...
@@ -347,21 +354,54 @@ void SimpleElement() : {}
void
IntElement
()
#
IntElement
:
{
Token
t
;
}
{
t
=
<
INTEGER_LITERAL
>
{
jjtThis
.
set
INTEGER_
LITERAL
(
t
.
image
);}
{
jjtThis
.
setLITERAL
(
t
.
image
);}
}
void
FloatElement
()
#
FloatElement
:
{
Token
t
;
}
{
t
=
<
FLOAT_LITERAL
>
{
jjtThis
.
set
FLOAT_
LITERAL
(
t
.
image
);}
{
jjtThis
.
setLITERAL
(
t
.
image
);}
}
void
StringElement
()
#
StringElement
:
{
Token
t
;
}
void
StringElement
()
#
StringElement
:
{
Token
t
;
String
s
;
}
{
t
=
<
IDENTIFIER
>
|
t
=
<
COMMA
>
|
t
=
<
MINUS
>
|
t
=
<
DOT
>
|
t
=
<
PLUS
>
|
t
=
<
SLASH
>
|
t
=
<
COLON
>
{
jjtThis
.
setIDENTIFIER
(
t
.
image
);}
}
t
=
<
IDENTIFIER
>
{
s
=
t
.
image
;
if
(
getToken
(
1
).
kind
!= START_TAG ) {
s
+=
getData
();
}
}
{
jjtThis
.
setLITERAL
(
s
);}
}
JAVACODE
String
getData
()
{
StringBuffer
s
=
new
StringBuffer
();
//
jjtThis
.
someData
=
true
;
while
((
getToken
(
1
)).
kind
!= START_TAG && (getToken(1)).kind != START_ENDTAG) {
Token
t
=
getNextToken
();
if
(
t
.
specialToken
!= null) {
Token
tmp_t
=
t
.
specialToken
;
while
(
tmp_t
.
specialToken
!= null) {
tmp_t
=
tmp_t
.
specialToken
;
}
while
(
tmp_t
!= null) {
s
.
append
(
tmp_t
.
image
);
tmp_t
=
tmp_t
.
next
;
}
}
s
.
append
(
t
.
image
);
}
return
s
.
toString
();
}
//
void
StringElement
()
#
StringElement
:
{
Token
t
;
}
//
{
//
t
=
<
IDENTIFIER
>
|
t
=
<
COMMA
>
|
t
=
<
MINUS
>
|
t
=
<
DOT
>
|
t
=
<
PLUS
>
|
t
=
<
SLASH
>
//
|
t
=
<
COLON
>
//
{
jjtThis
.
setIDENTIFIER
(
t
.
image
);}
//
}
void
OwlElement
()
:
{}
{
...
...
testontologies/v1.13.owl
View file @
54c2b20f
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment