All Downloads are FREE. Search and download functionalities are using the official Maven repository.

one.empty3.library1.tree.ControlledInstructions Maven / Gradle / Ivy

Go to download

3D rendering engine. Plus modelling. Expected glsl textures 3d and 2d rendering3D primitives, and a lot of scenes' samples to test.+ Game Jogl reworked, Calculator (numbers and vectors). Java code parser implementation starts (<=1.2)

The newest version!
package one.empty3.library1.tree;

import java.util.ArrayList;
import java.util.List;

public class ControlledInstructions extends Instruction {
    public String controlExpression;

    public ControlledInstructions(String controlExpression) {
        super(null);
        this.controlExpression = controlExpression;
    }

    public String getControlExpression() {
        return controlExpression;
    }

    public void setControlExpression(String controlExpression) {
        this.controlExpression = controlExpression;
    }

    public List getInstructionsList() {
        return instructionList;
    }

    public void setInstructionsList(ArrayList instructions) {
        this.instructionList = instructions;
    }

    public static class If extends ControlledInstructions {
        public InstructionBlock instructionsIf = new InstructionBlock();
        public InstructionBlock instructionsElse = new InstructionBlock();

        public If(String controlExpression) {
            super(controlExpression);
        }

        @Override
        public String toLangStringJava(boolean debug) {
            return super.toLangStringJava(debug);
        }
    }

    public static class For extends ControlledInstructions {
        public boolean forEachType = false;
        private Instruction loopInstruction = new Instruction();
        private Instruction firstForInstruction = new Instruction();

        public For(String controlExpression) {
            super(controlExpression);
            //this.firstForInstruction.add(initInstruction);
            //this.loopInstruction.add(loopInstruction);
            forEachType = false;
        }

        /***
         * For (Type variableName : expression)
         *     ==================  ===========
         *     loopInstruction     controlExpression
         * @param firstForInstruction
         * @param controlExpression
         */
        public For(Instruction firstForInstruction, String controlExpression) {
            super(controlExpression);
            this.firstForInstruction = firstForInstruction;
            this.controlExpression = controlExpression;
            forEachType = true;
        }

        public boolean isForEachType() {
            return forEachType;
        }

        public void setForEachType(boolean forEachType) {
            this.forEachType = forEachType;
        }

        public Instruction getLoopInstruction() {
            return loopInstruction == null ? new Instruction() : loopInstruction;
        }

        public void setLoopInstruction(Instruction loopInstruction) {
            this.loopInstruction = loopInstruction;
        }

        public Instruction getFirstForInstruction() {
            return firstForInstruction == null ? new Instruction() : firstForInstruction;
        }

        public void setFirstForInstruction(Instruction firstForInstruction) {
            this.firstForInstruction = firstForInstruction;
        }

        @Override
        public String toLangStringJava(boolean debug) {
            return super.toLangStringJava(debug);
        }
    }

    public static class While extends ControlledInstructions {
        public While(String controlExpression) {
            super(controlExpression);
        }

        @Override
        public String toLangStringJava(boolean debug) {
            return super.toLangStringJava(debug);
        }
    }

    public static class DoWhile extends ControlledInstructions {
        public DoWhile(String controlExpression) {
            super(controlExpression);
        }

        @Override
        public String toLangStringJava(boolean debug) {
            return super.toLangStringJava(debug);
        }

    }

    @Override
    public String toLangStringJava(boolean debug) {
        return super.toLangStringJava(debug);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy