//-------------------------------------------------------------------------------------------------- // // @ CopyRight Roberti & Parau Enterprises, Inc. 2021-2023 // // This work is licensed under the Creative Commons Attribution-NoDerivatives 4.0 International License. // To view a copy of this license, visit http://creativecommons.org/licenses/by-nd/4.0/ // or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. // //-------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------------------- // // ProcessOpCodes interface // //------------------------------------------------------------------------------------------------- package framework; import java.math.BigInteger; public abstract class DVOpCodeProcessor { public boolean preProcessOpCode(DVStatements.Statement owner) { return true; }; public DVExpression getValueExpression(DVStatements.Statement owner) { return null; } public DVExpression getReplExpression(DVOpCodeParm parm, DVStatements.Statement owner) { return null; } public DVCode generateCode(DVStatements.Statement owner) { return null; } // // Default attributes // public boolean getValueInParm() { return false; } public BigInteger getLength() { return BigInteger.ZERO; } public BigInteger getRepl() { return BigInteger.ONE; } public BigInteger getAlign() { return BigInteger.ONE; } public boolean getNeedSection() { return true; } public boolean getNeedLabel() { return false; } public boolean getNoLabel() { return false; } public int[] getPosParmMinMax() { return null; } public boolean[] getPosParmDefault() { return null; } public int[][] getSubParmMinMax() { return null; } public boolean[][] getSubParmDefault() { return null; } public String[] getKeyWordList() { return null; } // // Predefine static fields with most commonly used BigIntegers // public static final BigInteger BI_2 = BigInteger.valueOf( 2); public static final BigInteger BI_4 = BigInteger.valueOf( 4); public static final BigInteger BI_8 = BigInteger.valueOf( 8); public static final BigInteger BI_16 = BigInteger.valueOf( 16); public static final BigInteger BI_32 = BigInteger.valueOf( 32); public static final BigInteger BI_64 = BigInteger.valueOf( 64); public static final BigInteger BI_128 = BigInteger.valueOf( 128); public static final BigInteger BI_256 = BigInteger.valueOf( 256); public static final BigInteger BI_512 = BigInteger.valueOf( 512); public static final BigInteger BI_1K = BigInteger.valueOf( 1024); public static final BigInteger BI_2K = BigInteger.valueOf( 2*1024); public static final BigInteger BI_4K = BigInteger.valueOf( 4*1024); public static final BigInteger BI_8K = BigInteger.valueOf( 8*1024); public static final BigInteger BI_16K = BigInteger.valueOf(16*1024); public static final BigInteger BI_32K = BigInteger.valueOf(32*1024); public static final BigInteger BI_64K = BigInteger.valueOf(64*1024); enum RelocationType { NONE } }