summaryrefslogtreecommitdiffstats
path: root/Source/cmCommandArgumentParser.y
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2017-02-10 21:18:04 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2017-02-16 20:34:27 (GMT)
commit761ea20518081de976a40e590577056f23188fbd (patch)
tree1d31c2a3a986aa1208563a1ded30d7f6ea0feaf6 /Source/cmCommandArgumentParser.y
parent1728b9c076a34ef017f10499e5b637d025b2afd8 (diff)
downloadCMake-761ea20518081de976a40e590577056f23188fbd.zip
CMake-761ea20518081de976a40e590577056f23188fbd.tar.gz
CMake-761ea20518081de976a40e590577056f23188fbd.tar.bz2
cmCommandArgumentParser: reformat grammar
Diffstat (limited to 'Source/cmCommandArgumentParser.y')
-rw-r--r--Source/cmCommandArgumentParser.y180
1 files changed, 71 insertions, 109 deletions
diff --git a/Source/cmCommandArgumentParser.y b/Source/cmCommandArgumentParser.y
index 9a9ba10..cfd76d1 100644
--- a/Source/cmCommandArgumentParser.y
+++ b/Source/cmCommandArgumentParser.y
@@ -91,131 +91,93 @@ static void cmCommandArgument_yyerror(yyscan_t yyscanner, const char* message);
Start:
-GoalWithOptionalBackSlash
-{
- $<str>$ = 0;
- yyGetParser->SetResult($<str>1);
-}
+ GoalWithOptionalBackSlash {
+ $<str>$ = 0;
+ yyGetParser->SetResult($<str>1);
+ }
GoalWithOptionalBackSlash:
-Goal
-{
- $<str>$ = $<str>1;
-}
-|
-Goal cal_BSLASH
-{
- $<str>$ = yyGetParser->CombineUnions($<str>1, $<str>2);
-}
+ Goal {
+ $<str>$ = $<str>1;
+ }
+| Goal cal_BSLASH {
+ $<str>$ = yyGetParser->CombineUnions($<str>1, $<str>2);
+ }
Goal:
-{
- $<str>$ = 0;
-}
-|
-String Goal
-{
- $<str>$ = yyGetParser->CombineUnions($<str>1, $<str>2);
-}
+ {
+ $<str>$ = 0;
+ }
+| String Goal {
+ $<str>$ = yyGetParser->CombineUnions($<str>1, $<str>2);
+ }
String:
-OuterText
-{
- $<str>$ = $<str>1;
-}
-|
-Variable
-{
- $<str>$ = $<str>1;
-}
+ OuterText {
+ $<str>$ = $<str>1;
+ }
+| Variable {
+ $<str>$ = $<str>1;
+ }
OuterText:
-cal_NAME
-{
- $<str>$ = $<str>1;
-}
-|
-cal_AT
-{
- $<str>$ = $<str>1;
-}
-|
-cal_DOLLAR
-{
- $<str>$ = $<str>1;
-}
-|
-cal_LCURLY
-{
- $<str>$ = $<str>1;
-}
-|
-cal_RCURLY
-{
- $<str>$ = $<str>1;
-}
-|
-cal_SYMBOL
-{
- $<str>$ = $<str>1;
-}
+ cal_NAME {
+ $<str>$ = $<str>1;
+ }
+| cal_AT {
+ $<str>$ = $<str>1;
+ }
+| cal_DOLLAR {
+ $<str>$ = $<str>1;
+ }
+| cal_LCURLY {
+ $<str>$ = $<str>1;
+ }
+| cal_RCURLY {
+ $<str>$ = $<str>1;
+ }
+| cal_SYMBOL {
+ $<str>$ = $<str>1;
+ }
Variable:
-cal_ENVCURLY EnvVarName cal_RCURLY
-{
- $<str>$ = yyGetParser->ExpandSpecialVariable($<str>1,$<str>2);
- //std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "] [" << $<str>3 << "]" << std::endl;
-}
-|
-cal_NCURLY MultipleIds cal_RCURLY
-{
- $<str>$ = yyGetParser->ExpandSpecialVariable($<str>1,$<str>2);
- //std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "] [" << $<str>3 << "]" << std::endl;
-}
-|
-cal_DCURLY MultipleIds cal_RCURLY
-{
- $<str>$ = yyGetParser->ExpandVariable($<str>2);
- //std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "] [" << $<str>3 << "]" << std::endl;
-}
-|
-cal_ATNAME
-{
- $<str>$ = yyGetParser->ExpandVariableForAt($<str>1);
-}
+ cal_ENVCURLY EnvVarName cal_RCURLY {
+ $<str>$ = yyGetParser->ExpandSpecialVariable($<str>1, $<str>2);
+ }
+| cal_NCURLY MultipleIds cal_RCURLY {
+ $<str>$ = yyGetParser->ExpandSpecialVariable($<str>1, $<str>2);
+ }
+| cal_DCURLY MultipleIds cal_RCURLY {
+ $<str>$ = yyGetParser->ExpandVariable($<str>2);
+ }
+| cal_ATNAME {
+ $<str>$ = yyGetParser->ExpandVariableForAt($<str>1);
+ }
EnvVarName:
-MultipleIds
-{
- $<str>$ = $<str>1;
-}
-|
-cal_SYMBOL EnvVarName
-{
- $<str>$ = $<str>1;
-}
+ MultipleIds {
+ $<str>$ = $<str>1;
+ }
+| cal_SYMBOL EnvVarName {
+ $<str>$ = $<str>1;
+ }
MultipleIds:
-{
- $<str>$ = 0;
-}
-|
-ID MultipleIds
-{
- $<str>$ = yyGetParser->CombineUnions($<str>1, $<str>2);
-}
+ {
+ $<str>$ = 0;
+ }
+| ID MultipleIds {
+ $<str>$ = yyGetParser->CombineUnions($<str>1, $<str>2);
+ }
ID:
-cal_NAME
-{
- $<str>$ = $<str>1;
-}
-|
-Variable
-{
- $<str>$ = $<str>1;
-}
-
+ cal_NAME {
+ $<str>$ = $<str>1;
+ }
+| Variable {
+ $<str>$ = $<str>1;
+ }
+;
%%
/* End of grammar */