diff --git a/applications/test/dictionary/Make/files b/applications/test/dictionary/Make/files index 89d95d0298..6f1da0059a 100644 --- a/applications/test/dictionary/Make/files +++ b/applications/test/dictionary/Make/files @@ -1,6 +1,6 @@ dictionaryTest.C -calcEntry/calcEntryParser.ATG +calcEntry/calcEntryParser.atg calcEntry/calcEntryInternal.C calcEntry/calcEntry.C diff --git a/applications/test/dictionary/calcEntry/calcEntry.C b/applications/test/dictionary/calcEntry/calcEntry.C index 7e634bc8b4..0f0bfbbdc8 100644 --- a/applications/test/dictionary/calcEntry/calcEntry.C +++ b/applications/test/dictionary/calcEntry/calcEntry.C @@ -68,17 +68,23 @@ bool Foam::functionEntries::calcEntry::execute myErrorHandler("calcEntryInternal::Parser"); calcEntryInternal::Scanner scanner(iss); + + // set the starting line + scanner.Line(is.lineNumber()); + calcEntryInternal::Parser parser(&scanner, &myErrorHandler); // Attach dictionary context parser.dict(parentDict); - // Attach scalar functions - // parser.functions(parentDict); - parser.Parse(); - // make a small input list to contain the answer + // mostly have an extra newline in the lookahead token + // so subtract 1 to keep things vaguely in sync + // (this is still far from perfect) + is.lineNumber() = scanner.Line() - 1; + + // a small input list to contain the answer tokenList tokens(2); tokens[0] = parser.Result(); tokens[1] = token::END_STATEMENT; diff --git a/applications/test/dictionary/calcEntry/calcEntryParser.ATG b/applications/test/dictionary/calcEntry/calcEntryParser.atg similarity index 100% rename from applications/test/dictionary/calcEntry/calcEntryParser.ATG rename to applications/test/dictionary/calcEntry/calcEntryParser.atg diff --git a/wmake/rules/General/coco b/wmake/rules/General/coco index 12c11df4cf..97b345c512 100644 --- a/wmake/rules/General/coco +++ b/wmake/rules/General/coco @@ -1,6 +1,8 @@ -.SUFFIXES: .ATG +# handie Coco/R attributed grammars -ATGtoo = Coco -single -frames $(WM_THIRD_PARTY_DIR)/coco-r/src $$SOURCE -o $(OBJECTS_DIR) ; $(CC) $(c++FLAGS) -c $*.cpp -o $@ +.SUFFIXES: .atg -.ATG.dep: +atgtoo = Coco -single -frames $(WM_THIRD_PARTY_DIR)/coco-cpp/src $$SOURCE -o $(OBJECTS_DIR) ; $(CC) $(c++FLAGS) -c $*.cpp -o $@ + +.atg.dep: $(MAKE_DEP)