diff options
author | Adrian Thurston <thurston@complang.org> | 2012-07-01 20:25:09 -0400 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2012-07-01 20:25:09 -0400 |
commit | 024594868b14862744e990093ea061f20d48e55f (patch) | |
tree | 640718d4247a008ab43c6e21880e169b373f27a4 /src/parsetree.cc | |
parent | 247904a84430b8c9151fa6afb68f01b60afb92c9 (diff) | |
download | colm-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.cc | 4 |
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 ); |