Search in sources :

Example 6 with ISyntaxComponent

use of priv.bajdcc.LALR1.syntax.ISyntaxComponent in project jMiniLang by bajdcc.

the class FirstSetSolver method visitBegin.

@Override
public void visitBegin(SequenceExp node, VisitBag bag) {
    bag.bVisitChildren = false;
    bag.bVisitEnd = false;
    boolean zero = false;
    for (ISyntaxComponent exp : node.arrExpressions) {
        exp.visit(this);
        zero = bZero;
        if (!zero) {
            break;
        }
    }
    bZero = zero;
}
Also used : ISyntaxComponent(priv.bajdcc.LL1.syntax.ISyntaxComponent)

Example 7 with ISyntaxComponent

use of priv.bajdcc.LALR1.syntax.ISyntaxComponent in project jMiniLang by bajdcc.

the class SequenceExp method visit.

@Override
public void visit(ISyntaxComponentVisitor visitor) {
    VisitBag bag = new VisitBag();
    visitor.visitBegin(this, bag);
    if (bag.bVisitChildren) {
        for (ISyntaxComponent exp : arrExpressions) {
            exp.visit(visitor);
        }
    }
    if (bag.bVisitEnd) {
        visitor.visitEnd(this);
    }
}
Also used : ISyntaxComponent(priv.bajdcc.LL1.syntax.ISyntaxComponent) VisitBag(priv.bajdcc.util.VisitBag)

Example 8 with ISyntaxComponent

use of priv.bajdcc.LALR1.syntax.ISyntaxComponent in project jMiniLang by bajdcc.

the class FirstsetSolver method visitBegin.

@Override
public void visitBegin(SequenceExp node, VisitBag bag) {
    bag.bVisitChildren = false;
    bag.bVisitEnd = false;
    boolean zero = false;
    for (ISyntaxComponent exp : node.arrExpressions) {
        exp.visit(this);
        zero = bZero;
        if (!zero) {
            break;
        }
    }
    bZero = zero;
}
Also used : ISyntaxComponent(priv.bajdcc.LALR1.syntax.ISyntaxComponent)

Example 9 with ISyntaxComponent

use of priv.bajdcc.LALR1.syntax.ISyntaxComponent in project jMiniLang by bajdcc.

the class FirstsetSolver method visitBegin.

@Override
public void visitBegin(BranchExp node, VisitBag bag) {
    bag.bVisitChildren = false;
    bag.bVisitEnd = false;
    boolean zero = false;
    for (ISyntaxComponent exp : node.arrExpressions) {
        exp.visit(this);
        if (bZero) {
            zero = bZero;
        }
    }
    bZero = zero;
}
Also used : ISyntaxComponent(priv.bajdcc.LALR1.syntax.ISyntaxComponent)

Example 10 with ISyntaxComponent

use of priv.bajdcc.LALR1.syntax.ISyntaxComponent in project jMiniLang by bajdcc.

the class FirstSetSolver method visitBegin.

@Override
public void visitBegin(BranchExp node, VisitBag bag) {
    bag.bVisitChildren = false;
    bag.bVisitEnd = false;
    boolean zero = false;
    for (ISyntaxComponent exp : node.arrExpressions) {
        exp.visit(this);
        if (bZero) {
            zero = bZero;
        }
    }
    bZero = zero;
}
Also used : ISyntaxComponent(priv.bajdcc.LL1.syntax.ISyntaxComponent)

Aggregations

ISyntaxComponent (priv.bajdcc.LALR1.syntax.ISyntaxComponent)4 ISyntaxComponent (priv.bajdcc.LL1.syntax.ISyntaxComponent)4 VisitBag (priv.bajdcc.util.VisitBag)4 PropertyExp (priv.bajdcc.LALR1.syntax.exp.PropertyExp)2 SyntaxToString (priv.bajdcc.LALR1.syntax.stringify.SyntaxToString)2 BranchExp (priv.bajdcc.LALR1.syntax.exp.BranchExp)1 IExpCollction (priv.bajdcc.LALR1.syntax.exp.IExpCollction)1 OptionExp (priv.bajdcc.LALR1.syntax.exp.OptionExp)1 SequenceExp (priv.bajdcc.LALR1.syntax.exp.SequenceExp)1 RuleItem (priv.bajdcc.LALR1.syntax.rule.RuleItem)1 OperatorType (priv.bajdcc.LALR1.syntax.token.OperatorType)1