Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Milhomme Allan
JavaMetaParser
Commits
38110618
Commit
38110618
authored
Oct 22, 2018
by
Custom2043
Browse files
fix +++
parent
49f37624
Changes
4
Hide whitespace changes
Inline
Side-by-side
JMP.jar
View file @
38110618
No preview for this file type
MPL.mpl
View file @
38110618
...
@@ -22,13 +22,14 @@ equals = "="
...
@@ -22,13 +22,14 @@ equals = "="
Jump = "\r\n"|"\r"|"\n"
Jump = "\r\n"|"\r"|"\n"
Space = " "|"\t"
Space = " "|"\t"
allToken = "*"
Identifier = firstLetter:letter [{idName:(letter|digit)}]
Identifier = firstLetter:letter [{idName:(letter|digit)}]
ignore = {Space|Jump}
ignore = {Space|Jump}
SearchName = id:Identifier ":"
SearchName = id:Identifier ":"
LineHeader = [trans:transientToken] id:Identifier equals
LineHeader = [trans:transientToken] id:Identifier equals
TokenSearchToken = ([trans:transientToken] id:Identifier)|string:StringToken
TokenSearchToken =
[not:notToken]
([trans:transientToken] id:Identifier)|string:StringToken
|allToken
ArraySearchToken = [{minSize:digit} "-"] arrayOpen [orToken left:SearchToken] {searches:SearchToken} [right:SearchToken orToken] arrayClose ["-" {maxSize:digit}]
ArraySearchToken = [{minSize:digit} "-"] arrayOpen [orToken left:SearchToken] {searches:SearchToken} [right:SearchToken orToken] arrayClose ["-" {maxSize:digit}]
OptionalSearchToken = optionOpen {searches:SearchToken} optionClose
OptionalSearchToken = optionOpen {searches:SearchToken} optionClose
BracketSearchToken = exprOpen {searches:SearchToken} exprClose
BracketSearchToken = exprOpen {searches:SearchToken} exprClose
...
...
src/parser/OrSearch.java
View file @
38110618
...
@@ -27,6 +27,11 @@ public class OrSearch extends MultipleSearch
...
@@ -27,6 +27,11 @@ public class OrSearch extends MultipleSearch
@Override
@Override
MultipleSearch
addIgnore
(
Ignore
ignore
)
MultipleSearch
addIgnore
(
Ignore
ignore
)
{
{
return
new
BracketSearch
(
ignore
.
getRealSearch
(),
this
);
Search
[]
s
=
new
Search
[
this
.
getSearches
().
length
];
for
(
int
i
=
0
;
i
<
s
.
length
;
i
++)
s
[
i
]
=
TokenBuilder
.
addIgnoresToArray
(
ignore
,
new
Search
[]
{
this
.
getSearches
()[
i
]})[
0
];
return
new
OrSearch
(
s
);
}
}
}
}
src/parser/TokenBuilder.java
View file @
38110618
...
@@ -45,7 +45,7 @@ public class TokenBuilder extends Builder
...
@@ -45,7 +45,7 @@ public class TokenBuilder extends Builder
List
<
Search
>
searchesWithIgnore
=
new
LinkedList
<>();
List
<
Search
>
searchesWithIgnore
=
new
LinkedList
<>();
for
(
Search
s
:
searches
)
for
(
Search
s
:
searches
)
{
{
if
(
s
instanceof
TokenSearch
||
s
instanceof
OrSearch
)
if
(
s
instanceof
TokenSearch
)
searchesWithIgnore
.
add
(
s
);
searchesWithIgnore
.
add
(
s
);
else
if
(
s
instanceof
MultipleSearch
)
else
if
(
s
instanceof
MultipleSearch
)
searchesWithIgnore
.
add
(((
MultipleSearch
)
s
).
addIgnore
(
ignore
));
searchesWithIgnore
.
add
(((
MultipleSearch
)
s
).
addIgnore
(
ignore
));
...
@@ -127,16 +127,11 @@ public class TokenBuilder extends Builder
...
@@ -127,16 +127,11 @@ public class TokenBuilder extends Builder
toSearchIn
=
((
BracketSearch
)
array
[
i
].
getSearch
()).
getSearches
();
toSearchIn
=
((
BracketSearch
)
array
[
i
].
getSearch
()).
getSearches
();
Result
[][]
sortedResults
=
this
.
separateIgnoreResults
(
array
[
i
].
getArray
(),
toSearchIn
);
Result
[][]
sortedResults
=
this
.
separateIgnoreResults
(
array
[
i
].
getArray
(),
toSearchIn
);
r
.
add
(
new
Result
(
new
BracketSearch
(
toSearchIn
),
sortedResults
[
0
]));
r
.
add
(
new
Result
(
new
BracketSearch
(
toSearchIn
),
sortedResults
[
0
]));
toSearchIn
=
new
Search
[
sortedResults
[
1
].
length
];
for
(
int
j
=
0
;
j
<
toSearchIn
.
length
;
j
++)
toSearchIn
[
j
]
=
this
.
ignore
.
getRealSearch
();
rIgnored
.
add
(
new
Result
(
new
BracketSearch
(
toSearchIn
),
sortedResults
[
1
]));
rIgnored
.
add
(
new
Result
(
new
BracketSearch
(
toSearchIn
),
sortedResults
[
1
]));
}
}
resultWithoutIgnore
.
add
(
new
Result
(
s
,
r
.
toArray
(
new
Result
[
r
.
size
()])));
resultWithoutIgnore
.
add
(
new
Result
(
s
,
r
.
toArray
(
new
Result
[
r
.
size
()])));
ignoredResults
.
add
(
new
Result
(
s
,
rIgnored
.
toArray
(
new
Result
[
r
.
size
()])));
ignoredResults
.
add
(
new
Result
(
s
,
rIgnored
.
toArray
(
new
Result
[
r
Ignored
.
size
()])));
}
}
else
if
(
s
instanceof
OrSearch
||
s
instanceof
TokenSearch
)
else
if
(
s
instanceof
OrSearch
||
s
instanceof
TokenSearch
)
{
{
...
@@ -150,7 +145,12 @@ public class TokenBuilder extends Builder
...
@@ -150,7 +145,12 @@ public class TokenBuilder extends Builder
}
}
}
}
else
else
ignoredResults
.
add
(
results
[
position
]);
{
if
(
results
[
position
].
getArray
()
==
null
)
ignoredResults
.
add
(
results
[
position
]);
else
ignoredResults
.
add
(
results
[
position
].
getArray
()[
0
]);
}
position
++;
position
++;
}
}
...
...
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