Axiom/FriCAS Interpreter Main Loop

This is part of some experimental code that I am writing to implement the FriCAS interpreter using SPAD code. For an overview of this experiment see page here. For information about how this is done using the current boot/lisp code see the page here.

I have made this a domain so that it can hold parameters which would otherwise be global parameters in boot code. When the constructor 'spadInterpret' is called it sets up the parameters and then goes into the main interpreter loop reading lines and then acting on them.

(1) -> spadInterpret()
(m1) -> 1+2
   token:
   nonnullstream
      #
  ,
      #
  ,
      nonnullstream(#,0,1+2(),0,strings(),1())
  ,
      nonnullstream(#,0)
   lineoftoks:
   integer(posn(0(1+2,1,1,strings)))()
      key(posn(0(1+2,1,1,strings)))()
  ,
      integer(posn(0(1+2,1,1,strings)))()
      integer(posn(0(1+2,1,1,strings)))()
      0(1+2,1,1,strings)()()
         nonnullstream
     ,
         #
     ,
         #
     ,
         nonnullstream(#,0,NIL,1,strings(),1())
     ,
         nonnullstream(#,1)
      nonnullstream
  ,
      #
  ,
      #
  ,
      nonnullstream(#,0,NIL,1,strings(),1())
  ,
      nonnullstream(#,1)
   parse:
   1 + 2
(m2) ->  

Next step

Within the main interpreter code the first part is the tokeniser we discuss how it works and how to try it on the page here.

 


metadata block
see also:
Correspondence about this page

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2023 Martin John Baker - All rights reserved - privacy policy.