Commit 38ee6df4 authored by Mohamed, Fawzi Roberto (fawzi)'s avatar Mohamed, Fawzi Roberto (fawzi)
Browse files

add split meta element

parent 27c417ef
......@@ -17,7 +17,7 @@ package eu.nomad_lab.query
object MetaElement extends Enumeration {
type MetaElement = Value
val Data, Shape, Length, CIndex = Value
val Data, Shape, Length, CIndex, Split = Value
def toString(metaElement: MetaElement): String = {
metaElement match {
......@@ -29,6 +29,8 @@ object MetaElement extends Enumeration {
"length"
case CIndex =>
"c_index"
case Split =>
"split"
}
}
......@@ -41,6 +43,8 @@ object MetaElement extends Enumeration {
Length
else if (Seq("c_index", "cIndex", "g_index", "gIndex").foldLeft(false) { (b: Boolean, x: String) => b || metaElement.compareToIgnoreCase(x) == 0 })
CIndex
else if (metaElement.compareToIgnoreCase("split") == 0)
Split
else
throw new InvalidTerm(s"MetaElement $metaElement unknown")
}
......
......@@ -34,7 +34,7 @@ object AtomicTerm {
val nrRe = new Regex("""\A\s*((?<sign>[-+]?)(?:(?<nr>(?:[0-9]+\.?[0-9]*|\.[0-9]+)(?:[eE][-+][0-9]+)?)|(?<inf>[Ii][Nn][Ff](?:[Ii][Nn][Ii][Tt][Yy])?)|(?<nan>[Nn][Aa][Nn])))""", "all", "sign", "nr", "inf", "nan")
val termRe = new Regex(
"""\A\s*(?:(?<not>[Nn][Oo][Tt])\s+)?(?:(?<quantifier>[aA][nN][yY]|[aA][lL][lL](?:|[dD][aA][tT][aA]|[tT][aA][rR][gG][eE][tT])|[mM][aA][tT][cC][hH][iI][nN][gG])\s+)?(?<metaName>[a-zA-Z_0-9]+)(?:.(?<metaElement>shape|length|value|[cg]_?[Ii]ndex))?\s*(?<compareOp>!=|~|==?|<=?|>=?|eq|EQ|mc|MC|ne|NE|lt|LT|le|LE|gt|GT|ge|GE)?\s*""",
"""\A\s*(?:(?<not>[Nn][Oo][Tt])\s+)?(?:(?<quantifier>[aA][nN][yY]|[aA][lL][lL](?:|[dD][aA][tT][aA]|[tT][aA][rR][gG][eE][tT])|[mM][aA][tT][cC][hH][iI][nN][gG])\s+)?(?<metaName>[a-zA-Z_0-9]+)(?:.(?<metaElement>shape|length|value|[cg]_?[Ii]ndex|split))?\s*(?<compareOp>!=|~|==?|<=?|>=?|eq|EQ|mc|MC|ne|NE|lt|LT|le|LE|gt|GT|ge|GE)?\s*""",
"not", "quantifier", "metaName", "metaElement", "compareOp"
)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment