Author Topic: microB tokenizer  (Read 7893 times)

0 Members and 1 Guest are viewing this topic.

Aurel

  • Guest
microB tokenizer
« on: March 24, 2019, 01:42:12 AM »
f***
« Last Edit: July 10, 2020, 10:58:05 AM by Aurel »

Aurel

  • Guest
Re: microB tokenizer
« Reply #1 on: March 26, 2019, 09:51:57 AM »
A
« Last Edit: July 10, 2020, 10:57:39 AM by Aurel »

Aurel

  • Guest
Re: microB tokenizer
« Reply #2 on: August 25, 2019, 02:12:32 AM »
C
« Last Edit: July 10, 2020, 10:57:14 AM by Aurel »

jack

  • Guest
Re: microB tokenizer
« Reply #3 on: August 25, 2019, 03:20:03 AM »
Aurel, there are a number of places where you use Sub instead of Function, even though O2 will tolerate that, it does not look good to me
I translated you code to FreeBASIC because my PC is a Mac and therefore O2 is not available, it seems to run ok

Aurel

  • Guest
Re: microB tokenizer
« Reply #4 on: August 25, 2019, 03:36:20 AM »
f**k
« Last Edit: July 10, 2020, 10:56:56 AM by Aurel »

Aurel

  • Guest
Re: microB tokenizer
« Reply #5 on: August 25, 2019, 03:39:09 AM »
j
« Last Edit: July 10, 2020, 10:56:30 AM by Aurel »

jack

  • Guest
Re: microB tokenizer
« Reply #6 on: August 25, 2019, 03:59:43 AM »
Aurel, here's the output , I replaced MessageBox with a simple Print
Code: [Select]
Number of tokens: 15
Number of lines: 1
2
+
3
+
4
*
(
-
2
+
3
)
*
0.55
EOL

15
RESULT=7.2

jack

  • Guest
Re: microB tokenizer
« Reply #7 on: August 25, 2019, 04:04:07 AM »
I use name SUB when routine is small and when don't require Returned value.
if is larger then I use FUNCTION.
Code: [Select]
sub tokenizer(src as string) as int
about 8 more similar to that

jack

  • Guest
Re: microB tokenizer
« Reply #8 on: August 25, 2019, 04:56:24 AM »
Jack
In o2 it is the same to use SUB or FUNCTION
from OxigenBasic doc
Quote
Oxygen Basic Procedures
...
function   Defines a procedure that returns a value.
sub   Defines a procedure that does not return a value.

Aurel

  • Guest
Re: microB tokenizer
« Reply #9 on: August 25, 2019, 05:18:55 AM »
A
« Last Edit: July 10, 2020, 10:56:14 AM by Aurel »

Aurel

  • Guest
Re: microB tokenizer
« Reply #10 on: April 15, 2020, 11:14:28 AM »
T
« Last Edit: July 10, 2020, 10:55:55 AM by Aurel »

JRS

  • Guest
Re: microB tokenizer
« Reply #11 on: April 15, 2020, 07:20:04 PM »
Aurel,

ScriptBasic works great as an embedded scripting solution with O2.

The reverse is also true with O2 embedded in ScriptBasic via the DLLC extension module.

Aurel

  • Guest
Re: microB tokenizer
« Reply #12 on: April 15, 2020, 10:05:09 PM »
f***
« Last Edit: July 10, 2020, 10:55:31 AM by Aurel »

JRS

  • Guest
Re: microB tokenizer
« Reply #13 on: April 15, 2020, 11:05:56 PM »
Another idea is to use O2's JIT compiler feature to execute your expressions in another thread.

Aurel

  • Guest
Re: microB tokenizer
« Reply #14 on: May 12, 2020, 01:38:19 AM »
J
« Last Edit: July 10, 2020, 10:55:05 AM by Aurel »