File: Symbol.java

package info (click to toggle)
imagej 1.54g-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,520 kB
  • sloc: java: 132,209; sh: 286; xml: 255; makefile: 6
file content (37 lines) | stat: -rw-r--r-- 923 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package ij.macro;

/** Objects of this class are used as entries in the macro language symbol table. */
public class Symbol implements MacroConstants {
    public int type;
    public double value;
    public String str;

    Symbol(int token, String str) {
        type = token&0xffff;
        this.str = str;
    }

    Symbol(double value) {
        this.value = value;
    }

    int getFunctionType() {
        int t = 0;
        if (type>=300 && type<1000)
            t = PREDEFINED_FUNCTION;
        else if (type>=1000 && type<2000)
            t = NUMERIC_FUNCTION;
        else if (type>=2000 && type<3000)
            t = STRING_FUNCTION;
        else if (type>=3000 && type<4000)
            t = ARRAY_FUNCTION;
        else if (type>=4000 && type<5000)
            t =  VARIABLE_FUNCTION;
        return t;
    }

    public String toString() {
        return type+" "+value+" "+str;
    }

} // class Symbol