A Peek into Pugs Internals #46

Parsing terms

rule term
    { undef            : { return VUndef    }
    | (\d+)            : { return VInt($0)  }
    }

rule expr
    { <term>           : { return Val($term) }
    | (<expr>) (<[+-]>) (<expr>)
                       : { return Op(VStr($1), $0, $2) }
    }
Copyright © 2006 Gaal Yahas