From ddbf9d374e485b77bdbe589aa3ed15e925d86074 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 17 Jul 2011 14:25:49 -0400 Subject: [PATCH] Expressions - Reclassified attr (name:value) and attmod (name.mod:value) values as "exp", to be tokenized. --- src/Expression.cpp | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/Expression.cpp b/src/Expression.cpp index 28c2a2d49..f8ea6b8c0 100644 --- a/src/Expression.cpp +++ b/src/Expression.cpp @@ -761,8 +761,14 @@ void Expression::expand_pattern () } //////////////////////////////////////////////////////////////////////////////// -// Convert: [:=] -// To: = lex +// +----------------+ +----------+ +------+ +---------+ +// | : | | | | = | | | +// +----------------+ +----------+ +------+ +---------+ +// | | --> | | | op | | exp | +// +----------------+ +----------+ +------+ +---------+ +// | attr | | attr | | attr | | attr | +// +----------------+ +----------+ +------+ +---------+ +// void Expression::expand_attr () { Arguments temp; @@ -786,7 +792,7 @@ void Expression::expand_attr () temp.push_back (Triple (name, "lvalue", arg->_third)); temp.push_back (Triple ("=", "op", arg->_third)); - temp.push_back (Triple (value, "rvalue", arg->_third)); + temp.push_back (Triple (value, "exp", arg->_third)); delta = true; } else @@ -801,8 +807,14 @@ void Expression::expand_attr () } //////////////////////////////////////////////////////////////////////////////// -// Convert: .[:=] -// To: lex +// +----------------------+ +----------+ +-------+ +---------------+ +// | .: | | | | | | | +// +----------------------+ +----------+ +-------+ +---------------+ +// | | --> | | | op | | exp/string/rx | +// +----------------------+ +----------+ +-------+ +---------------+ +// | attr | | attr | | attr | | attr | +// +----------------------+ +----------+ +-------+ +---------------+ +// void Expression::expand_attmod () { Arguments temp; @@ -830,13 +842,13 @@ void Expression::expand_attmod () { temp.push_back (Triple (name, "lvalue", arg->_third)); temp.push_back (Triple ("<", "op", arg->_third)); - temp.push_back (Triple (value, "rvalue", arg->_third)); + temp.push_back (Triple (value, "exp", arg->_third)); } else if (mod == "after" || mod == "over" || mod == "above") { temp.push_back (Triple (name, "lvalue", arg->_third)); temp.push_back (Triple (">", "op", arg->_third)); - temp.push_back (Triple (value, "rvalue", arg->_third)); + temp.push_back (Triple (value, "exp", arg->_third)); } else if (mod == "none") { @@ -854,13 +866,13 @@ void Expression::expand_attmod () { temp.push_back (Triple (name, "lvalue", arg->_third)); temp.push_back (Triple ("=", "op", arg->_third)); - temp.push_back (Triple (value, "rvalue", arg->_third)); + temp.push_back (Triple (value, "exp", arg->_third)); } else if (mod == "isnt" || mod == "not") { temp.push_back (Triple (name, "lvalue", arg->_third)); temp.push_back (Triple ("!=", "op", arg->_third)); - temp.push_back (Triple (value, "rvalue", arg->_third)); + temp.push_back (Triple (value, "exp", arg->_third)); } else if (mod == "has" || mod == "contains") {