summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2012-08-12 10:13:05 -0400
committerAdrian Thurston <thurston@complang.org>2012-08-12 10:13:05 -0400
commit2a8724427e2c77fc004a5254dd6d885e39f9bf9a (patch)
tree8c3b17a2c1bedd5a995613a0bbcc7033f3f7cd0e
parent3761651c99bc940bb9c5fd5af03e9cbd224b4961 (diff)
downloadcolm-2a8724427e2c77fc004a5254dd6d885e39f9bf9a.tar.gz
struct Term -> LexTerm
-rw-r--r--colm/lmparse.kl20
-rw-r--r--colm/parsedata.h2
-rw-r--r--colm/parsetree.cc4
-rw-r--r--colm/parsetree.h30
4 files changed, 28 insertions, 28 deletions
diff --git a/colm/lmparse.kl b/colm/lmparse.kl
index 5765d0d8..8acdc563 100644
--- a/colm/lmparse.kl
+++ b/colm/lmparse.kl
@@ -955,7 +955,7 @@ literal_item: opt_no_ignore TK_Literal opt_no_ignore
if ( ldel != 0 )
error( $2->loc ) << "literal already defined in this namespace" << endp;
else {
- Join *join = new Join( Expression::cons( Term::cons( FactorWithAug::cons(
+ Join *join = new Join( Expression::cons( LexTerm::cons( FactorWithAug::cons(
FactorWithRep::cons( $2->loc, FactorWithNeg::cons( $2->loc, Factor::cons(
Literal::cons( $2->loc, $2->data,
Literal::LitString ) ) ) ) ) ) ) );
@@ -2143,7 +2143,7 @@ rl_expr:
nonterm rl_term_short
{
- Term *term;
+ LexTerm *term;
};
shortest rl_term_short;
@@ -2153,33 +2153,33 @@ rl_term_short: rl_term
nonterm rl_term
{
- Term *term;
+ LexTerm *term;
};
rl_term:
rl_term factor_with_label final {
- $$->term = Term::cons( $1->term, $2->factorWithAug );
+ $$->term = LexTerm::cons( $1->term, $2->factorWithAug );
};
rl_term:
rl_term '.' factor_with_label final {
- $$->term = Term::cons( $1->term, $3->factorWithAug );
+ $$->term = LexTerm::cons( $1->term, $3->factorWithAug );
};
rl_term:
rl_term TK_ColonGt factor_with_label final {
- $$->term = Term::cons( $1->term, $3->factorWithAug, Term::RightStartType );
+ $$->term = LexTerm::cons( $1->term, $3->factorWithAug, LexTerm::RightStartType );
};
rl_term:
rl_term TK_ColonGtGt factor_with_label final {
- $$->term = Term::cons( $1->term, $3->factorWithAug, Term::RightFinishType );
+ $$->term = LexTerm::cons( $1->term, $3->factorWithAug, LexTerm::RightFinishType );
};
rl_term:
rl_term TK_LtColon factor_with_label final {
- $$->term = Term::cons( $1->term,
- $3->factorWithAug, Term::LeftType );
+ $$->term = LexTerm::cons( $1->term,
+ $3->factorWithAug, LexTerm::LeftType );
};
rl_term:
factor_with_label final {
- $$->term = Term::cons( $1->factorWithAug );
+ $$->term = LexTerm::cons( $1->factorWithAug );
};
nonterm factor_with_label
diff --git a/colm/parsedata.h b/colm/parsedata.h
index 41ab9781..20c4c596 100644
--- a/colm/parsedata.h
+++ b/colm/parsedata.h
@@ -442,7 +442,7 @@ typedef AvlTree<Action, String, CmpStr> ActionDict;
struct VarDef;
struct Join;
struct Expression;
-struct Term;
+struct LexTerm;
struct FactorWithAug;
struct FactorWithLabel;
struct FactorWithRep;
diff --git a/colm/parsetree.cc b/colm/parsetree.cc
index ddd0f15d..6bdf0b9c 100644
--- a/colm/parsetree.cc
+++ b/colm/parsetree.cc
@@ -690,7 +690,7 @@ FsmGraph *Expression::walk( Compiler *pd, bool lastInSeq )
}
/* Clean up after a term node. */
-Term::~Term()
+LexTerm::~LexTerm()
{
switch ( type ) {
case ConcatType:
@@ -707,7 +707,7 @@ Term::~Term()
}
/* Evaluate a term node. */
-FsmGraph *Term::walk( Compiler *pd, bool lastInSeq )
+FsmGraph *LexTerm::walk( Compiler *pd, bool lastInSeq )
{
FsmGraph *rtnVal = 0;
switch ( type ) {
diff --git a/colm/parsetree.h b/colm/parsetree.h
index 3fe1c7ee..dd5d882c 100644
--- a/colm/parsetree.h
+++ b/colm/parsetree.h
@@ -159,7 +159,7 @@ struct Literal;
/* Tree nodes. */
-struct Term;
+struct LexTerm;
struct FactorWithAug;
struct FactorWithRep;
struct FactorWithNeg;
@@ -820,7 +820,7 @@ struct Expression
type((Type)-1), prev(this), next(this) { }
/* Construct with an expression on the left and a term on the right. */
- static Expression *cons( Expression *expression, Term *term, Type type )
+ static Expression *cons( Expression *expression, LexTerm *term, Type type )
{
Expression *ret = new Expression;
ret->type = type;
@@ -830,7 +830,7 @@ struct Expression
}
/* Construct with only a term. */
- static Expression *cons( Term *term )
+ static Expression *cons( LexTerm *term )
{
Expression *ret = new Expression;
ret->type = TermType;
@@ -855,7 +855,7 @@ struct Expression
/* Node data. */
Expression *expression;
- Term *term;
+ LexTerm *term;
BuiltinMachine builtin;
Type type;
@@ -863,9 +863,9 @@ struct Expression
};
/*
- * Term
+ * LexTerm
*/
-struct Term
+struct LexTerm
{
enum Type {
ConcatType,
@@ -875,41 +875,41 @@ struct Term
FactorWithAugType
};
- Term() :
+ LexTerm() :
term(0), factorWithAug(0), type((Type)-1) { }
- static Term *cons( Term *term, FactorWithAug *factorWithAug )
+ static LexTerm *cons( LexTerm *term, FactorWithAug *factorWithAug )
{
- Term *ret = new Term;
+ LexTerm *ret = new LexTerm;
ret->type = ConcatType;
ret->term = term;
ret->factorWithAug = factorWithAug;
return ret;
}
- static Term *cons( Term *term, FactorWithAug *factorWithAug, Type type )
+ static LexTerm *cons( LexTerm *term, FactorWithAug *factorWithAug, Type type )
{
- Term *ret = new Term;
+ LexTerm *ret = new LexTerm;
ret->type = type;
ret->term = term;
ret->factorWithAug = factorWithAug;
return ret;
}
- static Term *cons( FactorWithAug *factorWithAug )
+ static LexTerm *cons( FactorWithAug *factorWithAug )
{
- Term *ret = new Term;
+ LexTerm *ret = new LexTerm;
ret->type = FactorWithAugType;
ret->factorWithAug = factorWithAug;
return ret;
}
- ~Term();
+ ~LexTerm();
FsmGraph *walk( Compiler *pd, bool lastInSeq = true );
void makeNameTree( Compiler *pd );
- Term *term;
+ LexTerm *term;
FactorWithAug *factorWithAug;
Type type;