diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-06-08 18:18:31 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-06-08 18:18:31 (GMT) |
commit | bbf1c3a0e87c4358b65d41393455fc393d8e16e0 (patch) | |
tree | a2bd3776a2947d1caac17f2da80aa29844715077 /Source/cmCommandArgumentParser.y | |
parent | 859b51751811f1b4c160793010cf3ad20c00140d (diff) | |
download | CMake-bbf1c3a0e87c4358b65d41393455fc393d8e16e0.zip CMake-bbf1c3a0e87c4358b65d41393455fc393d8e16e0.tar.gz CMake-bbf1c3a0e87c4358b65d41393455fc393d8e16e0.tar.bz2 |
ENH: Handle more cases
Diffstat (limited to 'Source/cmCommandArgumentParser.y')
-rw-r--r-- | Source/cmCommandArgumentParser.y | 45 |
1 files changed, 34 insertions, 11 deletions
diff --git a/Source/cmCommandArgumentParser.y b/Source/cmCommandArgumentParser.y index 05a0674..dc1b9ee 100644 --- a/Source/cmCommandArgumentParser.y +++ b/Source/cmCommandArgumentParser.y @@ -49,7 +49,7 @@ YY_DECL; static void cmCommandArgumentError(yyscan_t yyscanner, const char* message); #define YYDEBUG 1 -#define YYMAXDEPTH 1000000 +#define YYMAXDEPTH 10000000 #define calCheckEmpty(cnt) yyGetParser->CheckEmpty(__LINE__, cnt, yyvsp); @@ -77,11 +77,14 @@ static void cmCommandArgumentError(yyscan_t yyscanner, const char* message); /* Tokens */ %token cal_NCURLY %token cal_DCURLY +%token cal_DOLLAR +%token cal_LCURLY %token cal_RCURLY %token cal_NAME %token cal_SYMBOL %token cal_AT %token cal_ERROR +%token cal_ATNAME /*-------------------------------------------------------------------------*/ /* grammar */ @@ -98,11 +101,10 @@ Goal } Goal: -String { - calElementStart(1); - calCheckEmpty(1); - $<str>$ = $<str>1; + calElementStart(0); + calCheckEmpty(0); + $<str>$ = 0; } | String Goal @@ -178,6 +180,27 @@ Text $<str>$ = $<str>1; } | +cal_AT +{ + calElementStart(1); + calCheckEmpty(1); + $<str>$ = $<str>1; +} +| +cal_DOLLAR +{ + calElementStart(1); + calCheckEmpty(1); + $<str>$ = $<str>1; +} +| +cal_LCURLY +{ + calElementStart(1); + calCheckEmpty(1); + $<str>$ = $<str>1; +} +| cal_RCURLY { calElementStart(1); @@ -191,7 +214,7 @@ cal_NCURLY MultipleIds cal_RCURLY calElementStart(3); calCheckEmpty(3); $<str>$ = yyGetParser->ExpandSpecialVariable($<str>1,$<str>2); - std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "] [" << $<str>3 << "]" << std::endl; + //std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "] [" << $<str>3 << "]" << std::endl; } | cal_DCURLY MultipleIds cal_RCURLY @@ -199,14 +222,14 @@ cal_DCURLY MultipleIds cal_RCURLY calElementStart(3); calCheckEmpty(3); $<str>$ = yyGetParser->ExpandVariable($<str>2); - std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "] [" << $<str>3 << "]" << std::endl; + //std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "] [" << $<str>3 << "]" << std::endl; } | -cal_AT cal_NAME cal_AT +cal_ATNAME { - calElementStart(3); - calCheckEmpty(3); - $<str>$ = yyGetParser->ExpandVariable($<str>2); + calElementStart(1); + calCheckEmpty(1); + $<str>$ = yyGetParser->ExpandVariable($<str>1); } %% |