X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fftacmp%2Fnic.l;h=9b1cec57990e8d5fa0578e9f099853e95a18959b;hb=07495effe193ca3f73c3bf0ce417068f9ac9dcdd;hp=82c0ebdc3fa377d5ecf6f44fe6125eaddabe085a;hpb=93d248304a68de7a8f9daf4aa74f9ee4cd27410c;p=com%2Fgs-lite.git diff --git a/src/ftacmp/nic.l b/src/ftacmp/nic.l index 82c0ebd..9b1cec5 100644 --- a/src/ftacmp/nic.l +++ b/src/ftacmp/nic.l @@ -1,226 +1,226 @@ -/* ------------------------------------------------ -Copyright 2014 AT&T Intellectual Property - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ------------------------------------------- */ - - -/* - MUST COMPILE WITH - flex -PNicParser -oniclexer.cc nic.l - (or equivalent). -*/ - -%{ -/* - * AT&T lex can't handle this lexer due to lex bugs. It works with flex - * 2.3.7, pclex 2.0.5, and MKS lex 3.1a. - */ - - #include "nic_def.h" - #include - - - -#include "nic.tab.cc.h" - -/* - Some includes that flex doesn't include as standard, - but which are needed. -*/ - -#include -#include - - -// Prevent flex from defining yywrap as extern "C" - -#define YY_SKIP_YYWRAP - -/* No lex lib, supply the yywrap fcn. that normally resides there -*/ - -int NicParserwrap(){return(1);} - -extern int NicParserdebug; - - -/* - These variables are used for error reporting: - flex_nic_lineno : the line currently being parsed when the error occurs. - flex_nic_ch : the character on the line where the error occurs - flex_nic_linebuf : store the line for reporting. - - NOTE : 1) the fixed size flex_nic_linebuf buffer is dangerous. - 2) You might get pointed to a place shortly after - where the syntax error occurs. It is close enough - for now. -*/ - -int flex_nic_lineno = 1; -int flex_nic_ch = 0; -char flex_nic_linebuf[20000]; - -char *flex_nic_stringinput = NULL; -int flex_nic_stringinput_ptr = 0; -FILE *flex_nic_fileinput = NULL; -int my_NicParser_yyinput(char *buf, int max_size); - - - -void NicParsererror(char *s){ - int i; - fprintf(stderr,"On line %d, char %d: %s (token %s):\n%s\n", - flex_nic_lineno, flex_nic_ch, s, NicParsertext, flex_nic_linebuf ); - for(i=0;i + + + +#include "nic.tab.cc.h" + +/* + Some includes that flex doesn't include as standard, + but which are needed. +*/ + +#include +#include + + +// Prevent flex from defining yywrap as extern "C" + +#define YY_SKIP_YYWRAP + +/* No lex lib, supply the yywrap fcn. that normally resides there +*/ + +int NicParserwrap(){return(1);} + +extern int NicParserdebug; + + +/* + These variables are used for error reporting: + flex_nic_lineno : the line currently being parsed when the error occurs. + flex_nic_ch : the character on the line where the error occurs + flex_nic_linebuf : store the line for reporting. + + NOTE : 1) the fixed size flex_nic_linebuf buffer is dangerous. + 2) You might get pointed to a place shortly after + where the syntax error occurs. It is close enough + for now. +*/ + +int flex_nic_lineno = 1; +int flex_nic_ch = 0; +char flex_nic_linebuf[20000]; + +char *flex_nic_stringinput = NULL; +int flex_nic_stringinput_ptr = 0; +FILE *flex_nic_fileinput = NULL; +int my_NicParser_yyinput(char *buf, int max_size); + + + +void NicParsererror(char *s){ + int i; + fprintf(stderr,"On line %d, char %d: %s (token %s):\n%s\n", + flex_nic_lineno, flex_nic_ch, s, NicParsertext, flex_nic_linebuf ); + for(i=0;i