Creates Flowgorithm files (.fprg) by parsing pseudo code files (.fgs) removing most initial need for the GUI application when first designing the program. This allows for a faster program design prior to Flowgorithm visual aids for refinement.
Download the FG_Parser.py
file and place it within your Flowgorithm workspace.
Enter the following command in your terminal:
python3 FG_Parser.py make YOURFILEGOESHERE.fgs
This will output the corresponding .fprg file that can be used with the Flowgorithms application.
Enter the following commands in your terminal for outputing a .fprg file of a different name from the .fgs file.
python3 FG_Parser.py -o YOURFGSFILE.fgs OUTPUTFILENAME.fprg
As you can see, this is supposed to function like compilers like gcc.
Input FOR_LOOP_EXAMPLE.fgs file:
def void() Main(){ String answer; String customerName; real purchaseAmount;#Define the Icv and initialize it output("Do you wish to process a customers information? "); input(answer); int i; #for Loop testing the Icv for(i;(100,10);1){ output("Enter the customers name"); input(customerName); output("How much did the customer spend"); input(purchaseAmount); output("+===================================================================+"); output(customerName & "spent" & purchaseAmount & "on the item"); output("+===================================================================+"); #update Icv answer output("Do you wish to process a customers information?"); input(answer); } output("end of program"); } def int(ii) cool(int x){ int ii; ii=x; }
Enter in your terminal:
python3 FG_Parser.py make forLoopExample.fgs
Output FOR_LOOP_EXAMPLE.fprg file:
<?xml version="1.0"?> <flowgorithm fileversion="2.11"> <attributes> <attribute name="name" value=""/> <attribute name="authors" value="Generated by FlogoScript Parser"/> <attribute name="about" value="FlowgoScript Parser is made by JustBobinAround, Check it out on github: https://github.com/JustBobinAround/Flowgorithm-Save-File-Parser"/> <attribute name="saved" value="2020-00-00 00:00:00 APM"/> <attribute name="created" value="emVsdGVrO3plbHRlay1QQzsyMDIwLTA5LTA5OzA5OjUwOjMwIFBNOzI3ODU="/> <attribute name="edited" value="emVsdGVrO3plbHRlay1QQzsyMDIwLTA5LTA5OzEwOjEyOjI2IFBNOzM7Mjg5MA=="/> </attributes> <function name="Main" type="None" variable=""> <parameters/> <body> <declare name="answer" type="String" array="False" size=""/> <declare name="customerName" type="String" array="False" size=""/> <declare name="purchaseAmount" type="Real" array="False" size=""/> <comment text="Define the Icv and initialize it"/> <output expression=""Do you wish to process a customers information? "" newline="True"/> <input variable="answer"/> <declare name="i" type="Integer" array="False" size=""/> <comment text="for Loop testing the Icv"/> <for variable="i" start="100" end="10" direction="inc" step="1"> <output expression=""Enter the customers name"" newline="True"/> <input variable="customerName"/> <output expression=""How much did the customer spend"" newline="True"/> <input variable="purchaseAmount"/> <output expression=""+===================================================================+"" newline="True"/> <output expression="customerName&"spent"&purchaseAmount&"on the item"" newline="True"/> <output expression=""+===================================================================+"" newline="True"/> <comment text="update Icv answer"/> <output expression=""Do you wish to process a customers information?"" newline="True"/> <input variable="answer"/> </for> <output expression=""end of program"" newline="True"/> </body> </function> <function name="cool" type="Integer" variable="ii"> <parameters> <parameter name="x" type="Integer" array="False"/> </parameters> <body> <declare name="ii" type="Integer" array="False" size=""/> <assign variable="ii" expression="x"/> </body> </function> </flowgorithm>
Please see the wiki for details on the Flogoscript Syntax:
FLOGOSCRIPT WIKI