MattiaRiola / FLC-practice

0 stars 0 forks source link

Problemi di installazione #1

Closed MattiaRiola closed 2 years ago

MattiaRiola commented 2 years ago

Problemi con l'installazione di jflex java_cup

Ho seguito il video su youtube e la guida dal suo sito

installazione di java

sembra funzionare

PS C:\Users\matti> javac -version
javac 19
PS C:\Users\matti> java -version
java version "19" 2022-09-20
Java(TM) SE Runtime Environment (build 19+36-2238)
Java HotSpot(TM) 64-Bit Server VM (build 19+36-2238, mixed mode, sharing)

compilazione di java_cup

PS C:\Program Files\FLC_Tools\java_cup_v11_draw_tree\java_cup> javac *.java runtime\*.java ..\StdDraw.java
production.java:157: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
      _all.put(new Integer(_index),this);
               ^
production.java:230: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    return (production) _all.get(new Integer(indx));
                                 ^
non_terminal.java:43: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
      _all_by_index.put(new Integer(_index), this);
                        ^
non_terminal.java:93: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
      Integer the_indx = new Integer(indx);
                         ^
terminal.java:48: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
      _all_by_index.put(new Integer(_index), this);
                        ^
terminal.java:117: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
      Integer the_indx = new Integer(indx);
                         ^
emit.java:514: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
                     pre("do_action_part")+ String.format("%08d",new Integer(instancecounter)) +"(");
                                                                 ^
emit.java:704: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
          out.println("              return " + pre("do_action_part")+ String.format("%08d",new Integer(0))+"(");
                                                                                            ^
emit.java:729: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
          out.println("              return " + pre("do_action_part")+ String.format("%08d",new Integer(instancecounter))+"(");
                                                                                            ^
emit.java:790: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
                     pre("do_action_part")+ String.format("%08d",new Integer(instancecounter)) +"(");
                                                                 ^
emit.java:957: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
          out.println("              return " + pre("do_action_part")+ String.format("%08d",new Integer(0))+"(");
                                                                                            ^
emit.java:982: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
          out.println("              return " + pre("do_action_part")+ String.format("%08d",new Integer(instancecounter))+"(");
                                                                                            ^
emit.java:1634: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
                     pre("do_action_part")+ String.format("%08d",new Integer(instancecounter)) +"(");
                                                                 ^
emit.java:1756: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
          out.println("              return " + pre("do_action_part")+ String.format("%08d",new Integer(0))+"(");
                                                                                            ^
emit.java:1781: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
          out.println("              return " + pre("do_action_part")+ String.format("%08d",new Integer(instancecounter))+"(");
                                                                                            ^
lalr_item_set.java:347: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
          hashcode_cache = new Integer(result);
                           ^
runtime\lr_parser.java:480: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
                  ret.add(new Integer(row[i]));
                          ^
runtime\DefaultSymbolFactory.java:29: warning: [dep-ann] deprecated item is not annotated with @Deprecated
    public DefaultSymbolFactory(){
           ^
runtime\virtual_parse_stack.java:93: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
      vstack.push(new Integer(stack_sym.parse_state));
                  ^
runtime\virtual_parse_stack.java:140: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
      vstack.push(new Integer(state_num));
                  ^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
20 warnings

Le variabili d'ambiente

sembrano essere settate correttamente:

PS C:\Users\matti\workspace\MattiaRiola\FLC-practice\exClass-2> echo $Env:PATH
C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files\Eclipse Adoptium\jre-18.0.1.10-hotspot\bin;C:\Program Files\Oculus\Support\oculus-runtime;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Program Files (x86)\Yarn\bin\;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\dotnet\;C:\Program Files\FLC_Tools\jflex-1.8.2\bin;C:\Program Files\FLC_Tools\java_cup_v11_draw_tree;.;C:\Users\matti\AppData\Local\Microsoft\WindowsApps;C:\Users\matti\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\matti\AppData\Roaming\npm;C:\Users\matti\AppData\Local\Yarn\bin;C:\Users\matti\.dotnet\tools
PS C:\Users\matti\workspace\MattiaRiola\FLC-practice\exClass-2> echo $Env:CLASSPATH
C:\Program Files\FLC_Tools\java_cup_v11_draw_tree;.;
PS C:\Users\matti\workspace\MattiaRiola\FLC-practice\exClass-2> echo $Env:JFLEX_HOME
C:\Program Files\FLC_Tools\jflex-1.8.2

Esecuzione dell'esempio

PS C:\Users\matti\workspace\MattiaRiola\FLC-practice\exClass-2> jflex scanner.jflex
Reading "scanner.jflex"
Constructing NFA : 32 states in NFA
Converting NFA to DFA :
............
14 states before minimization, 10 states in minimized DFA
Old file "Yylex.java" saved as "Yylex.java~"
Writing code to "Yylex.java"
PS C:\Users\matti\workspace\MattiaRiola\FLC-practice\exClass-2> javac *.java
Main.java:10: error: cannot find symbol
      parser p = new parser(l);
      ^
  symbol:   class parser
  location: class Main
Main.java:10: error: cannot find symbol
      parser p = new parser(l);
                     ^
  symbol:   class parser
  location: class Main
Yylex.java:624: error: cannot find symbol
          { return new java_cup.runtime.Symbol(sym.EOF); }
                                               ^
  symbol:   variable sym
  location: class Yylex
Yylex.java:639: error: cannot find symbol
            { System.out.println("OPEN BRACKET");return new Symbol(sym.OBRACKET);
                                                                   ^
  symbol:   variable sym
  location: class Yylex
Yylex.java:644: error: cannot find symbol
            { System.out.println("CLOSE BRACKET");return new Symbol(sym.CBRACKET);
                                                                    ^
  symbol:   variable sym
  location: class Yylex
Yylex.java:649: error: cannot find symbol
            { System.out.println("PLUS");return new Symbol(sym.PLUS);
                                                           ^
  symbol:   variable sym
  location: class Yylex
Yylex.java:654: error: cannot find symbol
            { System.out.println("MINUS");return new Symbol(sym.MINUS);
                                                            ^
  symbol:   variable sym
  location: class Yylex
Yylex.java:659: error: cannot find symbol
            { System.out.println("NUMBER:"+yytext());return new Symbol(sym.NUMBER);
                                                                       ^
  symbol:   variable sym
  location: class Yylex
Yylex.java:664: error: cannot find symbol
            { System.out.println("EQUAL");return new Symbol(sym.EQUAL);
                                                            ^
  symbol:   variable sym
  location: class Yylex
9 errors

Permessi cartella

image

MattiaRiola commented 2 years ago

A step was missing during the test of example2


jflex scanner.jflex
java java_cup.MainDrawTree parser.cup
javac *.java
java Main example_expr.txt