Search in sources :

Example 1 with DivExprToken

use of org.develnext.jphp.core.tokenizer.token.expr.operator.DivExprToken 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);
}
Also used : Context(php.runtime.env.Context) BooleanOr2ExprToken(org.develnext.jphp.core.tokenizer.token.expr.operator.BooleanOr2ExprToken) AssignExprToken(org.develnext.jphp.core.tokenizer.token.expr.operator.AssignExprToken) MulExprToken(org.develnext.jphp.core.tokenizer.token.expr.operator.MulExprToken) PowExprToken(org.develnext.jphp.core.tokenizer.token.expr.operator.PowExprToken) ConcatExprToken(org.develnext.jphp.core.tokenizer.token.expr.operator.ConcatExprToken) BooleanOrExprToken(org.develnext.jphp.core.tokenizer.token.expr.operator.BooleanOrExprToken) MinusExprToken(org.develnext.jphp.core.tokenizer.token.expr.operator.MinusExprToken) BooleanNotExprToken(org.develnext.jphp.core.tokenizer.token.expr.operator.BooleanNotExprToken) PlusExprToken(org.develnext.jphp.core.tokenizer.token.expr.operator.PlusExprToken) NewExprToken(org.develnext.jphp.core.tokenizer.token.expr.value.NewExprToken) BooleanXorExprToken(org.develnext.jphp.core.tokenizer.token.expr.operator.BooleanXorExprToken) BooleanAnd2ExprToken(org.develnext.jphp.core.tokenizer.token.expr.operator.BooleanAnd2ExprToken) Tokenizer(org.develnext.jphp.core.tokenizer.Tokenizer) BooleanAndExprToken(org.develnext.jphp.core.tokenizer.token.expr.operator.BooleanAndExprToken) DivExprToken(org.develnext.jphp.core.tokenizer.token.expr.operator.DivExprToken) ModExprToken(org.develnext.jphp.core.tokenizer.token.expr.operator.ModExprToken) Test(org.junit.Test)

Aggregations

Tokenizer (org.develnext.jphp.core.tokenizer.Tokenizer)1 AssignExprToken (org.develnext.jphp.core.tokenizer.token.expr.operator.AssignExprToken)1 BooleanAnd2ExprToken (org.develnext.jphp.core.tokenizer.token.expr.operator.BooleanAnd2ExprToken)1 BooleanAndExprToken (org.develnext.jphp.core.tokenizer.token.expr.operator.BooleanAndExprToken)1 BooleanNotExprToken (org.develnext.jphp.core.tokenizer.token.expr.operator.BooleanNotExprToken)1 BooleanOr2ExprToken (org.develnext.jphp.core.tokenizer.token.expr.operator.BooleanOr2ExprToken)1 BooleanOrExprToken (org.develnext.jphp.core.tokenizer.token.expr.operator.BooleanOrExprToken)1 BooleanXorExprToken (org.develnext.jphp.core.tokenizer.token.expr.operator.BooleanXorExprToken)1 ConcatExprToken (org.develnext.jphp.core.tokenizer.token.expr.operator.ConcatExprToken)1 DivExprToken (org.develnext.jphp.core.tokenizer.token.expr.operator.DivExprToken)1 MinusExprToken (org.develnext.jphp.core.tokenizer.token.expr.operator.MinusExprToken)1 ModExprToken (org.develnext.jphp.core.tokenizer.token.expr.operator.ModExprToken)1 MulExprToken (org.develnext.jphp.core.tokenizer.token.expr.operator.MulExprToken)1 PlusExprToken (org.develnext.jphp.core.tokenizer.token.expr.operator.PlusExprToken)1 PowExprToken (org.develnext.jphp.core.tokenizer.token.expr.operator.PowExprToken)1 NewExprToken (org.develnext.jphp.core.tokenizer.token.expr.value.NewExprToken)1 Test (org.junit.Test)1 Context (php.runtime.env.Context)1