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

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

flag flag flag flag flag flag Axiom Volume 1: Tutorial. Documentation is freely availible from: http://www.axiom-developer.org/axiom-website/documentation.html

 

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

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