use of org.develnext.jphp.core.tokenizer.token.expr.operator.BooleanAndExprToken in project jphp by jphp-compiler.
the class TokenizerTest method testSimpleOperators.
@Test
public void testSimpleOperators() throws IOException {
Tokenizer tokenizer = new Tokenizer(new Context("= + - / * % . and or new && || ! xor **"));
assertTrue(tokenizer.nextToken() instanceof AssignExprToken);
assertTrue(tokenizer.nextToken() instanceof PlusExprToken);
assertTrue(tokenizer.nextToken() instanceof MinusExprToken);
assertTrue(tokenizer.nextToken() instanceof DivExprToken);
assertTrue(tokenizer.nextToken() instanceof MulExprToken);
assertTrue(tokenizer.nextToken() instanceof ModExprToken);
assertTrue(tokenizer.nextToken() instanceof ConcatExprToken);
assertTrue(tokenizer.nextToken() instanceof BooleanAnd2ExprToken);
assertTrue(tokenizer.nextToken() instanceof BooleanOr2ExprToken);
assertTrue(tokenizer.nextToken() instanceof NewExprToken);
assertTrue(tokenizer.nextToken() instanceof BooleanAndExprToken);
assertTrue(tokenizer.nextToken() instanceof BooleanOrExprToken);
assertTrue(tokenizer.nextToken() instanceof BooleanNotExprToken);
assertTrue(tokenizer.nextToken() instanceof BooleanXorExprToken);
assertTrue(tokenizer.nextToken() instanceof PowExprToken);
}
use of org.develnext.jphp.core.tokenizer.token.expr.operator.BooleanAndExprToken in project jphp by jphp-compiler.
the class TokenizerTest method testComplexOperators.
@Test
public void testComplexOperators() throws IOException {
Tokenizer tokenizer = new Tokenizer(new Context("== >= <= === !== != && ||"));
assertTrue(tokenizer.nextToken() instanceof EqualExprToken);
assertTrue(tokenizer.nextToken() instanceof GreaterOrEqualExprToken);
assertTrue(tokenizer.nextToken() instanceof SmallerOrEqualToken);
assertTrue(tokenizer.nextToken() instanceof IdenticalExprToken);
assertTrue(tokenizer.nextToken() instanceof NotIdenticalExprToken);
assertTrue(tokenizer.nextToken() instanceof BooleanNotEqualExprToken);
assertTrue(tokenizer.nextToken() instanceof BooleanAndExprToken);
assertTrue(tokenizer.nextToken() instanceof BooleanOrExprToken);
}
Aggregations