In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the knowledge of "how to use the PostgreSQL lexical grammar parser to associate with dblink". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Yesterday, someone said that they didn't understand what was going on with that Op. Let's get it straight again. The code is under src/backend/parser, open them to taste carefully, very simple.
Scan.l is very different from gram.y, of course, the former is a flex script, while the latter is a yacc script; the former is lexical analysis, while the latter is parsing.
Let's take a look at the operator definition in scan.l. It consists of one or more of the following characters: ~! @ # ^ & `? +-* /% =. That's why we say that table_remote@dblink should be defined by operators, while other characters can be used directly, such as name_list', 'name. Here a comma can be used as a grammatical element because it does not appear in the list of characters defined by the lexical engine.
Op_chars [\ ~\!\ @\\ ^\ &\ |\ `\?\ +\ -\ *\ /\%\ =] operator {op_chars} +
Moving on, the code for operator in scan.l:
{operator} {(. ) yylval- > str = pstrdup (yytext); return Op;}
This determines whether the character sequence is Op, and if so, gram.y is instructed: the next token is Op.
Op can find the definition in the gram.h generated by gram.y:
# define Op 263
You can also know whether the token is @ in gram. String comparison is fine, because that's how it is defined in gram.y:
% token IDENT FCONST SCONST BCONST XCONST Op
More articles:
IBM "getting started with Yacc and Lex"
Google, Bing
Books
"lex and yacc"
I don't know how else to be more detailed. If I see more and understand more, I will know.
This is the end of the content of "how to use the PostgreSQL lexical grammar parser to associate with dblink". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.