Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Deep Basic
#1
...by Deep AI
mod by me in cca 300 LOC ... Big Grin
compiled in o2 (...fast compilation)
currently :

Code: (Select All)
'Deep Basic v1 in o2 /QB code by DeepAI /mod by Aurel
'Global block
Declare SUB RunProgram(lines() AS STRING)
Declare FUNCTION FindLabel(label as string ) AS INT
Declare FUNCTION EvalExpression(expr As STRING) AS FLOAT
Declare FUNCTION ParseTerm() AS FLOAT
Declare FUNCTION ParseFactor() AS FLOAT
Declare FUNCTION GetNextToken() AS STRING
Declare SUB SkipWhitespace()
' compiled ...OK!


Attached Files Image(s)
   
Reply
#2
Just to mention few days back i try to run this AI code in QBJS but seems not work
probably i do something wrong...so that is why i move code to o2 in which i am sure
what is what ..because i don't find solid QB online compiler ..also i try to modify code
in fact ask for FB version but AI is not that smart ..grrr.
Reply
#3
This compile fine too.. Wink 

Code: (Select All)
'Deep Basic v1 in o2 /QB code by DeepAI /mod by Aurel
'Global block
Declare SUB RunProgram(lines() AS STRING)
Declare FUNCTION FindLabel(label as string ) AS INT
Declare FUNCTION EvalExpression(expr As STRING) AS FLOAT
Declare FUNCTION ParseTerm() AS FLOAT
Declare FUNCTION ParseFactor() AS FLOAT
Declare FUNCTION GetNextToken() AS STRING
Declare SUB SkipWhitespace()
'print " compiled ...OK!"

Dim Lines[1024] AS STRING
Dim Labels[1024] AS STRING
Dim LabelLine[1024] AS INT

so far ... Rolleyes 

Code: (Select All)
'Deep Basic v1 in o2 /QB code by DeepAI /mod by Aurel
'Global block
Declare SUB RunProgram(lines() AS STRING)
Declare FUNCTION FindLabel(label as string ) AS INT
Declare FUNCTION EvalExpression(expr As STRING) AS FLOAT
Declare FUNCTION ParseTerm() AS FLOAT
Declare FUNCTION ParseFactor() AS FLOAT
Declare FUNCTION GetNextToken() AS STRING
Declare SUB SkipWhitespace()
'print " compiled ...OK!"

Dim Lines[1024] AS STRING
Dim Labels[1024] AS STRING
Dim LabelLine[1024] AS INT

Dim LineCount AS INT
Dim PC AS INT ' Program Counter
Dim Stack[128] AS INT
Dim StackPtr AS INT

Dim Variables[100] AS STRING
Dim VariablesVal[100] AS FLOAT

Dim Token as STRING : Dim TokenPos AS INT
Dim CurrentToken AS STRING
Dim Expr AS STRING
Reply
#4
...i must say that i am very stupid for console programs Big Grin 
but here is how look...


Attached Files Image(s)
   
Reply




Users browsing this thread: 1 Guest(s)