manpagez: man pages & more
info flex
Home | html | info | man

File: flex.info,  Node: Quoted Constructs,  Next: Addresses,  Prev: Identifiers,  Up: Common Patterns

A.4.3 Quoted Constructs
-----------------------

C99 String Literal
     'L?\"([^\"\\\n]|(\\['\"?\\abfnrtv])|(\\([0123456]{1,3}))|(\\x[[:xdigit:]]+)|(\\u([[:xdigit:]]{4}))|(\\U([[:xdigit:]]{8})))*\"'

C99 Comment
     '("/*"([^*]|"*"+[^*/])*"*"+"/")|("/"(\\\n)*"/"((\\\n)|[^\n])*)'

     Note that in C99, a '//'-style comment may be split across lines,
     and, contrary to popular belief, does not include the trailing '\n'
     character.

     A better way to scan '/* */' comments is by line, rather than
     matching possibly huge comments all at once.  This will allow you
     to scan comments of unlimited length, as long as line breaks appear
     at sane intervals.  This is also more efficient when used with
     automatic line number processing.  *Note option-yylineno::.

     {
         "/*"      yybegin(COMMENT);
     }
     {
         "*/"      yybegin(0);
         [^*\n]+   ;
         "*"[^/]   ;
         \n        ;
     }

© manpagez.com 2000-2026
Individual documents may contain additional copyright information.