// FILE. . . . . d:/hak/hlt/src/hlt/fot/fuz/syntax/sources/fff-ancillary-classes.grm // EDIT BY . . . Hassan Ait-Kaci // ON MACHINE. . Hak-Laptop // STARTED ON. . Tue Aug 21 05:20:57 2018 // Last modified on Wed Nov 28 15:10:47 2018 by hak %% /** * This is the class for terms being partially parsed as syntactic * objects and eventually translated into a FirstOrderTerm. * N.B.: numbers are not parsed as we consider only * symbolic functors. */ class SyntacticTerm { String symbol = null; Vector body = null; Functor functor = null; FirstOrderTerm term = null; FirstOrderTerm[] arguments = null; boolean isVariable = false; SyntacticTerm markAsVariable () { isVariable = true; return this; } SyntacticTerm (String symbol) { this.symbol = symbol; } SyntacticTerm (String symbol, Vector body) { this.symbol = symbol; this.body = body; } final boolean hasBody () { return (body != null && !body.isEmpty()); } public String toString () { if (!hasBody()) return symbol; StringBuffer s = new StringBuffer(symbol); s.append("("); for (int i=0; i