com.svincent.moksa
Class PrologTokenizer

java.lang.Object
  |
  +--com.svincent.moksa.WamObject
        |
        +--com.svincent.moksa.PrologTokenizer

public class PrologTokenizer
extends WamObject

This class encapsulates the tokenization of Prolog.

A PrologTokenizer has a single method, 'getToken', which returns a PrologTerm. This term is one of:

All strings, etc, have quote marks stripped and escape sequences expanded, so there is no need to do these things later on.

I believe that MoksaProlog will ship with two complete parsers: one written in Prolog, which supports the entire Prolog language, and one written completely in Java, which supports a subset.

Both of these parsers, I believe, shall be accessable to Prolog users, through various and sundry APIs.


Constructor Summary
PrologTokenizer(PrologFactory _factory)
           
 
Method Summary
 void consume(Io.PrologInput in, CompoundTerm expected)
           
static void main(java.lang.String[] args)
          Test code.
 CompoundTerm parseCompoundTerm(java.lang.String value)
          From something of the form "Shawn" Make something of the form [83,104,97,119,110]
 CompoundTerm peek(Io.PrologInput in)
           
 void pushback(Io.PrologInput in, CompoundTerm token)
           
 CompoundTerm readToken(Io.PrologInput in)
          Read a single token from 'in'.
 
Methods inherited from class com.svincent.moksa.WamObject
tag, tag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrologTokenizer

public PrologTokenizer(PrologFactory _factory)
Method Detail

pushback

public void pushback(Io.PrologInput in,
                     CompoundTerm token)

peek

public CompoundTerm peek(Io.PrologInput in)
                  throws java.io.IOException

consume

public void consume(Io.PrologInput in,
                    CompoundTerm expected)
             throws java.io.IOException,
                    PrologParseException

readToken

public CompoundTerm readToken(Io.PrologInput in)
                       throws java.io.IOException
Read a single token from 'in'. This is the only public API on PrologTokenizer: all the rest of its methods exist solely to service it.


parseCompoundTerm

public CompoundTerm parseCompoundTerm(java.lang.String value)
From something of the form "Shawn" Make something of the form [83,104,97,119,110]

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Test code.



This is documentation for Moksa Prolog, which can be found at http://www.svincent.com/moksa/

Copyright © 1999 Shawn P. Vincent.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.