BlitzScript3D

Blitz3D Forums/Blitz3D Programming/BlitzScript3D

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.


However, the following line concerns me.

If GSC_TokenType = TOKEN_IF Then GSC_AddWarning("Ambiguous coding style (may cause unexpected errors - see language manual)")


.This suggest that the implementation does not support nested IF..THEN. Please correct me if I'm wrong.


This isn't exactly what it seems. Testing the next token for "If" only detects if the programmer typed something like:

If <condition> Then
  <statements>
Else If <condition> Then 'This is not elseif to the compiler
  <statemtnts>
EndIf

, which is the same as:
If <condition> Then
  <statements>
Else
  If <condition> Then 'Unclosed if

EndIf


, since I haven't implimented any ElseIf behaviour. The reason an "Else" followed by an "If" on a new line would not generate this warning is my compiler returns TOKEN_TERMINATOR when a new-line character (chr(13)) is found OR ";" is found (the equivelant of Blitz3D's ":").

I intend the VM to read Pcode and the compiler to write to Pcode as well (I mistook OPcode and Pcode as being synonomous). The file "manipulation" scheme I plan to impliment is slightly similar to BlitzScript3D:

The compiler writes the date/time stamp of the script file to the Pcode file. When the VM finds only the Pcode file, it will run that. If it finds only the Script file, it will compile and run that. But, if it finds both the script and Pcode file, it will check to see whether the Pcode file is up-to-date (if the date/time stamp of the script file equals the one writen within the Pcode file). If the Pcode is up-to-date, there's no need to recompile and can simply load that. If not, the souce will be recompiled (and therefore will not be recompiled until the source code's date/time stamp is changed by an edit).