summaryrefslogtreecommitdiff
path: root/src/parsetree.cc
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2012-07-01 20:25:09 -0400
committerAdrian Thurston <thurston@complang.org>2012-07-01 20:25:09 -0400
commit024594868b14862744e990093ea061f20d48e55f (patch)
tree640718d4247a008ab43c6e21880e169b373f27a4 /src/parsetree.cc
parent247904a84430b8c9151fa6afb68f01b60afb92c9 (diff)
downloadcolm-024594868b14862744e990093ea061f20d48e55f.tar.gz
using static constructors for creating Expression
The advantage of static constructors is that we can use common constructors for initializing fields.
Diffstat (limited to 'src/parsetree.cc')
-rw-r--r--src/parsetree.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/parsetree.cc b/src/parsetree.cc
index 084ffbb8..496167e4 100644
--- a/src/parsetree.cc
+++ b/src/parsetree.cc
@@ -610,6 +610,8 @@ FsmGraph *Join::walk( Compiler *pd )
Expression::~Expression()
{
switch ( type ) {
+ case None:
+ break;
case OrType: case IntersectType: case SubtractType:
case StrongSubtractType:
delete expression;
@@ -628,6 +630,8 @@ FsmGraph *Expression::walk( Compiler *pd, bool lastInSeq )
{
FsmGraph *rtnVal = 0;
switch ( type ) {
+ case None:
+ break;
case OrType: {
/* Evaluate the expression. */
rtnVal = expression->walk( pd, false );