Examples of PsInput


Examples of org.axsl.ps.PsInput

     * @throws PsInterpreterException4a For PostScript errors.
     * @throws PsOperatorException For PostScript operator errors.
     */
    @Test
    public void testFalseOperator01() throws PsInterpreterException4a, PsOperatorException {
        final PsInput input = new PsStringInput("false");
        final PsInterpreter4a interpreter = new PsInterpreter4a(input, null);
        interpreter.process();
        assertEquals(1, interpreter.getOperandStack().size());
        final PsObject object = interpreter.getOperandStack().pop();
        assertTrue(object instanceof PsBoolean);
View Full Code Here

Examples of org.axsl.ps.PsInput

     * @throws PsOperatorException For PostScript operator errors.
     */
    @Test
    public void testNeg01() throws PsInterpreterException4a, PsOperatorException {
        /* First example from the PSLRM, 2nd Ed. */
        PsInput input = new PsStringInput("4.5 neg");
        PsInterpreter4a interpreter = new PsInterpreter4a(input, null);
        interpreter.process();
        PsObject object = interpreter.getOperandStack().pop();
        assertTrue(object instanceof PsReal);
        assertEquals(new BigDecimal("-4.5"), ((PsReal) object).getValue());
View Full Code Here

Examples of org.axsl.ps.PsInput

        /* Second example from the PSLRM, 2nd Ed. */
        generalBooleanTest("false not", true);

        /* Third example from the PSLRM, 2nd Ed. */
        final PsInput input = new PsStringInput("52 not");
        final PsInterpreter4a interpreter = new PsInterpreter4a(input, null);
        interpreter.process();
        final PsObject object = interpreter.getOperandStack().pop();
        assertTrue(object instanceof PsInteger);
        assertEquals(new BigDecimal(-53), ((PsInteger) object).getValue());
View Full Code Here

Examples of org.axsl.ps.PsInput

        /* Fourth example from the PSLRM, 2nd Ed. */
        generalBooleanTest("false false or", false);

        /* Fifth example from the PSLRM, 2nd Ed. */
        final PsInput input = new PsStringInput("17 5 or");
        final PsInterpreter4a interpreter = new PsInterpreter4a(input, null);
        interpreter.process();
        final PsObject object = interpreter.getOperandStack().pop();
        assertTrue(object instanceof PsInteger);
        assertEquals(new BigDecimal(21), ((PsInteger) object).getValue());
View Full Code Here

Examples of org.axsl.ps.PsInput

        /* Fourth example from the PSLRM, 2nd Ed. */
        generalBooleanTest("false false xor", false);

        /* Fifth example from the PSLRM, 2nd Ed. */
        PsInput input = new PsStringInput("7 3 xor");
        PsInterpreter4a interpreter = new PsInterpreter4a(input, null);
        interpreter.process();
        PsObject object = interpreter.getOperandStack().pop();
        assertTrue(object instanceof PsInteger);
        assertEquals(new BigDecimal(4), ((PsInteger) object).getValue());
View Full Code Here

Examples of org.axsl.ps.PsInput

        /* Fourth example from the PSLRM, 2nd Ed. */
        generalBooleanTest("false false and", false);

        /* Fifth example from the PSLRM, 2nd Ed. */
        PsInput input = new PsStringInput("99 1 and");
        PsInterpreter4a interpreter = new PsInterpreter4a(input, null);
        interpreter.process();
        PsObject object = interpreter.getOperandStack().pop();
        assertTrue(object instanceof PsInteger);
        assertEquals(new BigDecimal(1), ((PsInteger) object).getValue());
View Full Code Here

Examples of org.axsl.ps.PsInput

     * @throws PsOperatorException For PostScript operator errors.
     */
    @Test
    public void testCvx01() throws PsInterpreterException4a, PsOperatorException {
        /* First create a name and make sure it is not executable. */
        PsInput input = new PsStringInput("/literal");
        PsInterpreter4a interpreter = new PsInterpreter4a(input, null);
        interpreter.process();
        PsObject object = interpreter.getOperandStack().pop();
        assertTrue(object instanceof PsName);
        PsName psName = (PsName) object;
View Full Code Here

Examples of org.axsl.ps.PsInput

     * @throws PsInterpreterException4a For PostScript errors.
     * @throws PsOperatorException For PostScript operator errors.
     */
    @Test
    public void testExec01() throws PsInterpreterException4a, PsOperatorException {
        final PsInput input = new PsStringInput("(3 2 add) cvx exec");
        final PsInterpreter4a interpreter = new PsInterpreter4a(input, null);
        interpreter.process();
        final PsObject object = interpreter.getOperandStack().pop();
        assertTrue(object instanceof PsInteger);
        final PsInteger psInteger = (PsInteger) object;
View Full Code Here

Examples of org.axsl.ps.PsInput

     * @throws PsInterpreterException4a For PostScript errors.
     * @throws PsOperatorException For PostScript operator errors.
     */
    @Test
    public void testExec02() throws PsInterpreterException4a, PsOperatorException {
        final PsInput input = new PsStringInput("3 2 /add exec");
        final PsInterpreter4a interpreter = new PsInterpreter4a(input, null);
        interpreter.process();
        assertEquals(3, interpreter.getOperandStack().size());
        /* Test top operand on stack. */
        PsObject object = interpreter.getOperandStack().pop();
View Full Code Here

Examples of org.axsl.ps.PsInput

     * @throws PsInterpreterException4a For PostScript errors.
     * @throws PsOperatorException For PostScript operator errors.
     */
    @Test
    public void testExec03() throws PsInterpreterException4a, PsOperatorException {
        final PsInput input = new PsStringInput("3 2 /add cvx exec");
        final PsInterpreter4a interpreter = new PsInterpreter4a(input, null);
        interpreter.process();
        final PsObject object = interpreter.getOperandStack().pop();
        assertTrue(object instanceof PsInteger);
        final PsInteger psInteger = (PsInteger) object;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.