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
359b0e9e
Commit
359b0e9e
authored
Oct 12, 2018
by
Custom2043
Browse files
Fix any and none ParserCharacter
parent
0e2d62e3
Changes
6
Hide whitespace changes
Inline
Side-by-side
JMP.jar
View file @
359b0e9e
No preview for this file type
MPL.mpl
View file @
359b0e9e
quote = "\""
singleQuote = "\'"
backslash = "\\"
anyCharToken = "\*"
#NumberChar = "0" (base:"b" {value:'0-1'})|(base:"x" {value:'0-9|A-F'})|(base:"d" {value:digit})
#SingleChar = (backslash backslash:("b"|"r"|"t"|"n"|backslash|
anyCharToken|
quote|singleQuote)) | anyChar
| anyCharToken
#SingleChar = (backslash backslash:("b"|"r"|"t"|"n"|backslash|quote|singleQuote)) | anyChar
CharacterToken = singleQuote [notToken:notToken] {|orToken character1:(NumberChar|SingleChar) ["-" character2:(NumberChar|SingleChar)]} singleQuote
StringToken = (quote {charTokens:(CharacterToken | SingleChar)} quote) | singleChar:CharacterToken
...
...
@@ -39,4 +38,4 @@ OrSearchToken = 2-{searches:#SearchToken orToken|}
Line = header:LineHeader {namedSearches:SearchToken}
anyChar =
"*"
anyChar =
'*'
src/parser/ParserString.java
View file @
359b0e9e
...
...
@@ -7,7 +7,7 @@ public class ParserString extends Token
public
static
final
ParserStringBuilder
quote
=
new
ParserStringBuilder
(
false
,
0
,
0
),
singleQuote
=
new
ParserStringBuilder
(
false
,
1
,
1
),
backslash
=
new
ParserStringBuilder
(
false
,
2
,
2
),
anyCharToken
=
new
ParserStringBuilder
(
fals
e
,
3
,
3
),
anyCharToken
=
new
ParserStringBuilder
(
tru
e
,
3
,
3
),
trans0
=
new
ParserStringBuilder
(
true
,
4
,
4
),
trans1
=
new
ParserStringBuilder
(
true
,
4
,
5
),
trans2
=
new
ParserStringBuilder
(
true
,
4
,
6
),
...
...
src/parser/Token.java
View file @
359b0e9e
...
...
@@ -14,7 +14,6 @@ public abstract class Token
ParserString
.
quote
,
ParserString
.
singleQuote
,
ParserString
.
backslash
,
ParserString
.
anyCharToken
,
ParserString
.
orToken
,
CharacterToken
.
builder
,
StringToken
.
builder
,
...
...
src/tokens/CharacterToken.java
View file @
359b0e9e
...
...
@@ -52,6 +52,9 @@ public class CharacterToken extends Token
public
ParserCharacter
toParserCharacter
()
{
if
(
this
.
character1
.
length
==
1
&&
this
.
character1
[
0
].
total
.
equals
(
"*"
)
&&
this
.
character2
[
0
]
==
null
)
return
this
.
notToken
==
null
?
ParserCharacter
.
any
:
ParserCharacter
.
none
;
char
[]
start
=
new
char
[
this
.
character1
.
length
],
end
=
new
char
[
this
.
character1
.
length
];
for
(
int
i
=
0
;
i
<
start
.
length
;
i
++)
{
...
...
src/tokens/SingleChar.java
View file @
359b0e9e
...
...
@@ -48,8 +48,8 @@ public class SingleChar extends Token
)
),
new
OrSearch
(
new
TokenSearch
(
ParserString
.
anyChar
)
,
new
TokenSearch
(
ParserString
.
anyCharToken
)
new
TokenSearch
(
ParserString
.
anyChar
)
//
new TokenSearch(ParserString.anyCharToken)
)
)
};
...
...
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