Hey all,

I am trying to add new opening and closing tags (<?php - ?>) mainly for
testing functionality and curiosity.  I believe, after 5 hours, that I have
tracked down the location of where this is defined,
Zend/zend_language_scanner.l.  Here is a snippet of what was originally
there:

<INITIAL>"<?php"([ \t]|{NEWLINE}) {
 zendlval->value.str.val = yytext; /* no copying - intentional */
 zendlval->value.str.len = yyleng;
 zendlval->type = IS_STRING;
 HANDLE_NEWLINE(yytext[yyleng-1]);
 BEGIN(ST_IN_SCRIPTING);
 return T_OPEN_TAG;
}

What I have done is simply this:

<INITIAL>"<@abc"([ \t]|{NEWLINE}) {
 zendlval->value.str.val = yytext; /* no copying - intentional */
 zendlval->value.str.len = yyleng;
 zendlval->type = IS_STRING;
 HANDLE_NEWLINE(yytext[yyleng-1]);
 BEGIN(ST_IN_SCRIPTING);
 return T_OPEN_TAG;
}

As for the closing tag, I have made the appropriate changes shown below.

<ST_ONE_LINE_COMMENT>"?>"|"%>"|"@>" {
    if (CG(asp_tags) || yytext[yyleng-2] != '%') { /* asp comment? */
  zendlval->value.str.val = yytext; /* no copying - intentional */
  zendlval->value.str.len = yyleng;
  zendlval->type = IS_STRING;
  yyless(yyleng-2);
  BEGIN(ST_IN_SCRIPTING);
  return T_COMMENT;
 } else {
  yymore();
 }
}

and

<ST_IN_SCRIPTING>("?>"|"@>"|"</script"{WHITESPACE}*">"){NEWLINE}? {
 zendlval->value.str.val = yytext; /* no copying - intentional */
 zendlval->value.str.len = yyleng;
 zendlval->type = IS_STRING;
 BEGIN(INITIAL);
 return T_CLOSE_TAG;  /* implicit ';' at php-end tag */
}

As far as I can tell, it looks like it should.  However when I try to
compile the code, I receive the following error:

"./zend_language_scanner.l", line 973: warning, rule cannot be matched

where line 973 is the line that my modification began, or the new opening
tag that I have added starts.  I am not very well skilled in C, as yet, so
any help and/or comments on how I might be able to correct this slight
problem would be greatly appreciated.

As I mentioned before, at this time I am trying this out to satisfy my
curiosity.  Please remember this when/if you respond to my inquiry.

Thank you ahead of time.

Jordan S. Jones

Please remove the appropriate information from my email address before
sending.





-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to