Browse Source

[5014_phase2] Fixed default rule (flex -s)

Francis Dupont 8 years ago
parent
commit
dd3c52d99c
1 changed files with 6 additions and 3 deletions
  1. 6 3
      src/bin/dhcp6/dhcp6_lexer.ll

+ 6 - 3
src/bin/dhcp6/dhcp6_lexer.ll

@@ -148,15 +148,18 @@ JSONString                              \"{JSONStringCharacter}*\"
 
 
     driver.includeFile(tmp);
     driver.includeFile(tmp);
 }
 }
+<DIR_ENTER,DIR_INCLUDE,DIR_EXIT><<EOF>> {
+    isc_throw(isc::BadValue, "Directive not closed.");
+}
 <DIR_EXIT>"?>" BEGIN(INITIAL);
 <DIR_EXIT>"?>" BEGIN(INITIAL);
     
     
 
 
-{blank}+   {
+<*>{blank}+   {
     // Ok, we found a with space. Let's ignore it and update loc variable.
     // Ok, we found a with space. Let's ignore it and update loc variable.
     loc.step();
     loc.step();
 }
 }
 
 
-[\n]+      {
+<*>[\n]+      {
     // Newline found. Let's update the location and continue.
     // Newline found. Let's update the location and continue.
     loc.lines(yyleng);
     loc.lines(yyleng);
     loc.step();
     loc.step();
@@ -792,7 +795,7 @@ null {
    return isc::dhcp::Dhcp6Parser::make_NULL_TYPE(loc);
    return isc::dhcp::Dhcp6Parser::make_NULL_TYPE(loc);
 }
 }
 
 
-.   driver.error (loc, "Invalid character: " + std::string(yytext));
+<*>.   driver.error (loc, "Invalid character: " + std::string(yytext));
 
 
 <<EOF>> {
 <<EOF>> {
     if (states.empty()) {
     if (states.empty()) {