From 06ae269c7c5cdda32072f3f00cf644e540ba12cd Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 10 Nov 2003 11:00:38 +0000 Subject: [PATCH] * Do not filter when parsing. This is much faster. * Add some rejections and lexical restrictions to the grammar to make this work. --- src/fix-ng/fix.sdf | 6 ++++++ src/fix-ng/parser.cc | 1 + 2 files changed, 7 insertions(+) diff --git a/src/fix-ng/fix.sdf b/src/fix-ng/fix.sdf index 30f930686..54f5d5266 100644 --- a/src/fix-ng/fix.sdf +++ b/src/fix-ng/fix.sdf @@ -91,6 +91,10 @@ exports lexical syntax [a-zA-Z\_][a-zA-Z0-9\_\']* -> Id "rec" -> Id {reject} + "let" -> Id {reject} + "if" -> Id {reject} + "then" -> Id {reject} + "else" -> Id {reject} "true" -> Id {reject} "false" -> Id {reject} "assert" -> Id {reject} @@ -108,6 +112,7 @@ exports lexical restrictions Id -/- [a-zA-Z0-9\_\'] Int -/- [0-9] + Path -/- [a-zA-Z0-9\.\_\-\+\/] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -126,6 +131,7 @@ exports "//" Uauthority Uabspath? -> Unetpath "/" Upathsegments -> Uabspath + "//" Uuric* -> Uabspath {reject} Urelsegment Uabspath? -> Urelpath (Uunreserved | Uescaped | [\;\@\&\=\+\$\,])+ -> Urelsegment diff --git a/src/fix-ng/parser.cc b/src/fix-ng/parser.cc index 43678ec97..93afe0627 100644 --- a/src/fix-ng/parser.cc +++ b/src/fix-ng/parser.cc @@ -109,6 +109,7 @@ Expr parseExprFromFile(Path path) SG_OUTPUT_ON(); SG_ASFIX2ME_ON(); SG_AMBIGUITY_ERROR_ON(); + SG_FILTER_OFF(); initialised = true; }