Interpreter.LispInterpreter.LispLexer
Class LispLexer

java.lang.Object
  |
  +--Interpreter.Sexp.Utils.Lexer.StreamTokenizerWithAtom
        |
        +--Interpreter.Sexp.Utils.Lexer.LexerMask
              |
              +--Interpreter.Sexp.Utils.Lexer.Lexer
                    |
                    +--Interpreter.LispInterpreter.LispLexer.LispLexer

public class LispLexer
extends Lexer

Analizzatore lessicale per linguaggio Scheme.
Specifica le proprietà del linguaggio Scheme rispetto a quelle generiche della classe Lexer.
Utilizza gli insiemi di parole chiave definiti nel package Interpreter.LispInterpreter.LispLexer.Sets.


Fields inherited from class Interpreter.Sexp.Utils.Lexer.Lexer
OperationalSet, PrimitiveSet, RelationalSet, SpecialSet
 
Fields inherited from class Interpreter.Sexp.Utils.Lexer.StreamTokenizerWithAtom
nospaces, nval, sval, TT_ATOM, TT_EOF, TT_EOL, TT_NUMBER, TT_WORD, ttype
 
Constructor Summary
LispLexer(java.io.Reader I, PrimitiveSet ps)
          Costruisce un LispLexer che analizzerà la stringa passata come parametro.
LispLexer(java.lang.String s, PrimitiveSet ps)
          Costruisce un LispLexer che analizzerà la stringa passata come parametro.
 
Method Summary
protected  Sexp BuildSpecial(java.lang.String tok)
          Definisce il comportamento del lexer per le chiavi particolari.
static void main(java.lang.String[] args)
          La classe LispLexer contiene il main per testarla.
protected  void Symbols(PrimitiveSet ps)
          Introduce il carattere di commento ';' e definisce i set di parole e simboli chiave.
 
Methods inherited from class Interpreter.Sexp.Utils.Lexer.Lexer
getToken, LoadKeys, next
 
Methods inherited from class Interpreter.Sexp.Utils.Lexer.StreamTokenizerWithAtom
atom, commentChar, eolIsSignificant, lineno, lowerCaseMode, nextToken, ordinaryChar, ordinaryChars, parseNumbers, pushBack, quoteChar, resetSyntax, slashSlashComments, slashStarComments, toString, whitespaceChars, wordChars
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LispLexer

public LispLexer(java.io.Reader I,
                 PrimitiveSet ps)
Costruisce un LispLexer che analizzerà la stringa passata come parametro. Introduce il carattere di commento ';' e definisce i set di parole e simboli chiave.
Parameters:
I - è l'input da analizzare.
ps - specifica quale deve essere il PrimitiveSet dell'interprete; consente la definizione di nuove primitive.

LispLexer

public LispLexer(java.lang.String s,
                 PrimitiveSet ps)
Costruisce un LispLexer che analizzerà la stringa passata come parametro. Introduce il carattere di commento ';' e definisce i set di parole e simboli chiave.
Parameters:
s - è la stringa da analizzare.
ps - specifica quale deve essere il PrimitiveSet dell'interprete; consente la definizione di nuove primitive.
Method Detail

Symbols

protected void Symbols(PrimitiveSet ps)
Introduce il carattere di commento ';' e definisce i set di parole e simboli chiave.
Parameters:
ps - è il PrimitiveSet

BuildSpecial

protected Sexp BuildSpecial(java.lang.String tok)
                     throws InterpreterException
Definisce il comportamento del lexer per le chiavi particolari.
Parameters:
tok - è il token con cui costruire un oggetto di tipo speciale.
Returns:
l'oggetto costruito.
Overrides:
BuildSpecial in class Lexer

main

public static void main(java.lang.String[] args)
La classe LispLexer contiene il main per testarla.


Codice realizzato da Francesco Geri & Marco Tamanti