use of de.be4.eventb.core.parser.node.TIdentifierLiteral in project probparsers by bendisposto.
the class Utils method getTIdentifierListAsString.
public static String getTIdentifierListAsString(final List<TIdentifierLiteral> idElements) {
final String string;
if (idElements.size() == 1) {
// faster version for the simple case
string = idElements.get(0).getText();
} else {
final StringBuilder idName = new StringBuilder();
boolean first = true;
for (final TIdentifierLiteral e : idElements) {
if (first) {
first = false;
} else {
idName.append('.');
}
idName.append(e.getText());
}
string = idName.toString();
}
return string.trim();
}
use of de.be4.eventb.core.parser.node.TIdentifierLiteral in project probparsers by bendisposto.
the class Utils method getIdentifierAsString.
public static String getIdentifierAsString(final List<TIdentifierLiteral> idElements) {
final StringBuilder idName = new StringBuilder();
for (final TIdentifierLiteral e : idElements) {
idName.append(e.getText());
idName.append('.');
}
if (idElements.size() > 0) {
idName.deleteCharAt(idName.length() - 1);
}
return idName.toString().trim();
}
use of de.be4.eventb.core.parser.node.TIdentifierLiteral in project probparsers by bendisposto.
the class Utils method getIdentifierAsString.
public static String getIdentifierAsString(final List<TIdentifierLiteral> idElements) {
final StringBuilder idName = new StringBuilder();
for (final TIdentifierLiteral e : idElements) {
idName.append(e.getText());
idName.append('.');
}
if (idElements.size() > 0) {
idName.deleteCharAt(idName.length() - 1);
}
return idName.toString().trim();
}
use of de.be4.eventb.core.parser.node.TIdentifierLiteral in project probparsers by bendisposto.
the class PrimedIdentifierCheck method getIdentifier.
private static String getIdentifier(final LinkedList<TIdentifierLiteral> identifiers) {
StringBuilder sb = new StringBuilder();
boolean first = true;
for (TIdentifierLiteral id : identifiers) {
if (!first) {
sb.append('.');
}
sb.append(id.getText().trim());
first = false;
}
return sb.toString();
}
use of de.be4.eventb.core.parser.node.TIdentifierLiteral in project probparsers by bendisposto.
the class EBLexer method filter.
@Override
protected void filter() throws LexerException, IOException {
super.filter();
if (token != null && token instanceof TIdentifierLiteral && v.get(token.getText())) {
Queue<IToken> ts = getNextList();
List<IToken> toks = getTokenList();
int l = token.getLine();
int p = token.getPos();
TLeftPar t1 = new TLeftPar(l, p);
ts.add(t1);
toks.add(t1);
ts.add(token);
toks.add(token);
TEqual t2 = new TEqual("=", l, p);
ts.add(t2);
toks.add(t2);
TTrue t3 = new TTrue("TRUE", l, p);
ts.add(t3);
toks.add(t3);
TRightPar t4 = new TRightPar(l, p);
ts.add(t4);
toks.add(t4);
token = null;
}
}
Aggregations