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
a36581b2
Commit
a36581b2
authored
Feb 27, 2019
by
Milhomme Allan
Browse files
Add list search names
parent
fd06002d
Changes
6
Show whitespace changes
Inline
Side-by-side
JMP.jar
0 → 100644
View file @
a36581b2
File added
Test.mpl
View file @
a36581b2
T = "a"
T =
{
"a"
[#b:"b"]}
\ No newline at end of file
src/compiler/ClassGenerator.java
View file @
a36581b2
...
...
@@ -249,7 +249,7 @@ public class ClassGenerator
builder
.
append
(
"\""
);
builder
.
append
(
name
.
id
.
getName
());
builder
.
append
(
"\", "
);
builder
.
append
(
name
.
list
);
builder
.
append
(
name
.
list
!=
null
);
builder
.
append
(
", "
);
}
}
...
...
src/compiler/Compiler.java
View file @
a36581b2
...
...
@@ -150,6 +150,14 @@ public class Compiler
pathForThisName
.
add
(
level
,
new
SearchPath
(
currentPath
,
token
));
}
if
(
type
.
searchName
.
list
!=
null
)
{
if
(
level
==
0
)
report
(
new
Info
(
InfoModel
.
listIsntInArraySearch
,
type
.
searchName
.
id
));
if
(!(
token
instanceof
TokenSearchToken
))
report
(
new
Info
(
InfoModel
.
listIsntATokenSearch
,
type
.
searchName
.
id
));
}
}
if
(
type
.
searchName
!=
null
&&
type
.
searchName
!=
null
)
...
...
@@ -210,8 +218,10 @@ public class Compiler
report
(
new
Info
(
InfoModel
.
emptyArray
,
token
));
boolean
b
=
first
;
if
(
token
instanceof
ArraySearchToken
)
level
++;
int
i
=
0
;
for
(
SearchToken
tt
:
((
MultipleSearchToken
)
token
).
getTypes
())
{
...
...
src/compiler/Info.java
View file @
a36581b2
...
...
@@ -35,7 +35,9 @@ enum InfoModel
illegalIdentifier
(
Etat
.
ERROR
,
"This name is not allowed"
),
invalidTransSearch
(
Etat
.
ERROR
,
"'#' can only be used with a transient token"
),
incorrectRange
(
Etat
.
ERROR
,
"Min and max size must be positive integers (min <= max)"
),
nonExistentIgnore
(
Etat
.
ERROR
,
"Can't use ignore because it has not been defined"
)
nonExistentIgnore
(
Etat
.
ERROR
,
"Can't use ignore because it has not been defined"
),
listIsntInArraySearch
(
Etat
.
ERROR
,
"A list cannot be used outside of an array search"
),
listIsntATokenSearch
(
Etat
.
ERROR
,
"A list can only be used on a token search"
)
;
public
final
Etat
etat
;
...
...
src/tokens/SearchName.java
View file @
a36581b2
...
...
@@ -10,8 +10,12 @@ public class SearchName extends Token
public
Result
searchResults
[];
public
Identifier
id
;
public
ParserString
list
;
public
ParserString
notGenerated
;
public
static
final
Search
builderSearches
[]
=
{
new
OptionalSearch
(
new
TokenSearch
(
"list"
,
false
,
ParserString
.
transientToken
)
),
new
OptionalSearch
(
new
TokenSearch
(
"notGenerated"
,
false
,
ParserString
.
nonGeneratedName
)
),
...
...
@@ -20,6 +24,4 @@ public class SearchName extends Token
};
/********** Do not modify or remove **********/
public
boolean
list
=
false
;
}
Write
Preview
Markdown
is supported
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