コード例 #1
0
ファイル: PTPrintfn.java プロジェクト: inudeb/PTScript
  @Override
  public void ejecutarSintaxis() throws Exception {
    if (this.s != null) {
      if (s.TipoDato() == Simbolo.TipoSimbolo.Cadena)
        System.out.println(((SymString) s).getValor());
      if (s.TipoDato() == Simbolo.TipoSimbolo.Entero) System.out.println(((SymInt) s).getValor());
      if (s.TipoDato() == Simbolo.TipoSimbolo.Flotante) System.out.println(((SymInt) s).getValor());
      if (s.TipoDato() == Simbolo.TipoSimbolo.Booleano) System.out.println(((SymInt) s).getValor());
    }
    if (this.texto != null) {
      if (this.texto instanceof PTConcat) {
        ((PTConcat) this.texto).verificarTablaSimbolos(tab);

        ((PTConcat) this.texto).ejecutarSintaxis();
        System.out.println(((PTConcat) this.texto).getConcatResult());
      } else System.out.println(texto);
    }
  }
コード例 #2
0
  public void definir(Simbolo simbolo) {

    obterMembros().put(simbolo.nome, simbolo);

    simbolo.escopo = this;
  }