Search in sources :

Example 1 with SyntaxToString

use of priv.bajdcc.LL1.syntax.stringify.SyntaxToString in project jMiniLang by bajdcc.

the class Syntax method getSingleString.

/**
 * 获得单一产生式描述
 *
 * @param name
 *            非终结符名称
 * @param exp
 *            表达式树
 * @param focused
 *            焦点
 * @param front
 *            前向
 * @return 原产生式描述
 */
public static String getSingleString(String name, ISyntaxComponent exp, ISyntaxComponent focused, boolean front) {
    StringBuilder sb = new StringBuilder();
    sb.append(name);
    sb.append(" -> ");
    SyntaxToString alg = new SyntaxToString(focused, front);
    exp.visit(alg);
    sb.append(alg.toString());
    return sb.toString();
}
Also used : SyntaxToString(priv.bajdcc.LALR1.syntax.stringify.SyntaxToString)

Example 2 with SyntaxToString

use of priv.bajdcc.LL1.syntax.stringify.SyntaxToString in project jMiniLang by bajdcc.

the class Syntax method getSingleString.

/**
 * 获得单一产生式描述
 *
 * @param name
 *            非终结符名称
 * @param exp
 *            表达式树
 * @param focused
 *            焦点
 * @param front
 *            前向
 * @return 原产生式描述
 */
public static String getSingleString(String name, ISyntaxComponent exp, ISyntaxComponent focused, boolean front) {
    StringBuilder sb = new StringBuilder();
    sb.append(name);
    sb.append(" -> ");
    SyntaxToString alg = new SyntaxToString(focused, front);
    exp.visit(alg);
    sb.append(alg.toString());
    return sb.toString();
}
Also used : SyntaxToString(priv.bajdcc.LL1.syntax.stringify.SyntaxToString)

Example 3 with SyntaxToString

use of priv.bajdcc.LL1.syntax.stringify.SyntaxToString in project jMiniLang by bajdcc.

the class Syntax method getSingleString.

/**
 * 获得单一产生式描述
 *
 * @param name
 *            非终结符名称
 * @param exp
 *            表达式树
 * @return 原产生式描述
 */
public static String getSingleString(String name, ISyntaxComponent exp) {
    StringBuilder sb = new StringBuilder();
    sb.append(name);
    sb.append(" -> ");
    SyntaxToString alg = new SyntaxToString();
    exp.visit(alg);
    sb.append(alg.toString());
    return sb.toString();
}
Also used : SyntaxToString(priv.bajdcc.LL1.syntax.stringify.SyntaxToString)

Example 4 with SyntaxToString

use of priv.bajdcc.LL1.syntax.stringify.SyntaxToString in project jMiniLang by bajdcc.

the class Syntax method getSingleString.

/**
 * 获得单一产生式描述
 *
 * @param name
 *            非终结符名称
 * @param exp
 *            表达式树
 * @return 原产生式描述
 */
public static String getSingleString(String name, ISyntaxComponent exp) {
    StringBuilder sb = new StringBuilder();
    sb.append(name);
    sb.append(" -> ");
    SyntaxToString alg = new SyntaxToString();
    exp.visit(alg);
    sb.append(alg.toString());
    return sb.toString();
}
Also used : SyntaxToString(priv.bajdcc.LALR1.syntax.stringify.SyntaxToString)

Aggregations

SyntaxToString (priv.bajdcc.LALR1.syntax.stringify.SyntaxToString)2 SyntaxToString (priv.bajdcc.LL1.syntax.stringify.SyntaxToString)2