labss.generator
Class Parser

java.lang.Object
  |
  +--labss.generator.Parser

public class Parser
extends java.lang.Object

Fornisce due metodi alternativi per fare il parsing della code section. Il primo si basa sul design pattern Builder il secondo su Iterator. Il primo

Author:
Riccardo Solmi

Nested Class Summary
static class Parser.Token
          Token restituito dall'iteratore.
 
Field Summary
static int END_OPTIONAL_BLOCK
          Codice per token di tipo fine blocco opzionale.
static int SLOT_REF
          Codice per token di tipo riferimento a slot.
static int START_OPTIONAL_BLOCK
          Codice per token di tipo inizio blocco opzionale.
static int TEXT
          Codice per token di tipo testo.
 
Constructor Summary
Parser()
           
 
Method Summary
static java.util.Iterator parseCodeSection(java.lang.String codeSection)
          Restituisce un Iterator per visitare la sequenza dei token della code section.
static void parseCodeSection(java.lang.String codeSection, ICodeBuilder builder)
          Costruisce una rappresentazione della code section usando l'interfaccia del builder.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEXT

public static final int TEXT
Codice per token di tipo testo.

See Also:
Constant Field Values

SLOT_REF

public static final int SLOT_REF
Codice per token di tipo riferimento a slot.

See Also:
Constant Field Values

START_OPTIONAL_BLOCK

public static final int START_OPTIONAL_BLOCK
Codice per token di tipo inizio blocco opzionale.

See Also:
Constant Field Values

END_OPTIONAL_BLOCK

public static final int END_OPTIONAL_BLOCK
Codice per token di tipo fine blocco opzionale.

See Also:
Constant Field Values
Constructor Detail

Parser

public Parser()
Method Detail

parseCodeSection

public static void parseCodeSection(java.lang.String codeSection,
                                    ICodeBuilder builder)
Costruisce una rappresentazione della code section usando l'interfaccia del builder.

Parameters:
codeSection - Stringa code section di un frame
builder - Builder che costruisce l'albero

parseCodeSection

public static java.util.Iterator parseCodeSection(java.lang.String codeSection)
Restituisce un Iterator per visitare la sequenza dei token della code section.

Parameters:
codeSection - Stringa code section di un frame
Returns:
Uno standard Iterator per visitare la sequenza dei token