//-------------------------------------------------------------------------------------------------- // // @ 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. // //-------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------ // // Javacc parser use for inline code lines in macros // //------------------------------------------------------------------------------ options { STATIC= false; SUPPORT_CLASS_VISIBILITY_PUBLIC= true; FORCE_LA_CHECK= true; LOOKAHEAD= 1; } PARSER_BEGIN(DVMacroInlineParser) package framework; public class DVMacroInlineParser { // // Class fields // protected String[] retString= { "", "", "", "" }; protected String error= ""; private int ndx= 0; } PARSER_END(DVMacroInlineParser) // // Token manager declarations // TOKEN_MGR_DECLS : { private int outerState= -1; } // // Tokens // TOKEN : { "))> : COMM_STATE } TOKEN : { | { if (this.outerState == -1) { this.outerState= curLexState; SwitchTo(SQ_STATE); } else { if (curLexState == SQ_STATE) { SwitchTo(this.outerState); this.outerState= -1; } } } | { if (this.outerState == -1) { this.outerState= curLexState; SwitchTo(DQ_STATE); } else { if (curLexState == DQ_STATE) { SwitchTo(this.outerState); this.outerState= -1; } } } | | } TOKEN : { } TOKEN : { : OPCODE_STATE | } TOKEN : { : PARMS_STATE | } TOKEN : { } TOKEN : { } // // Start grammar here // void start(): { Token t; } { ( t=