Re: How does the parser work?
James said: >The host phase of Waf build generates tablegen which in turn generates >keywords.h IIRC. I have no idea how the internals work. I took a look at the code. It looks like there are 2 tables of keywords, one in ntp_keyword.h (build by keyword-gen) and another in ntp_parser.y. Because the tokens in each table look so similar, my brain jumped to the conclusion that they were parallel. Wrong. The values of the corresponding tokens are different. I don't know how the values from the keyword table get translated into parser values. The parser table also has a few extra entries like integer and string. keyword.h is more than just a list of keywords. It's also table/tree of steps along the way of recognizing a keyword: S_ST( 's',3, 675, 422 ), /* 674 tru */ S_ST( 't',3, 676, 0 ), /* 675 trus */ S_ST( 'e',3, 677, 0 ), /* 676 trust */ S_ST( 'd',3, 678, 0 ), /* 677 truste*/ S_ST( 'k',3, 679, 0 ), /* 678 trusted */ S_ST( 'e',3, 423, 0 ), /* 679 trustedk */ Anyway, I think extra "keywords" in the parser table are just useless. The parser will never get there because the keyword table doesn't know about them. When we run out of better things to do, we should make a config file that uses all the keywords so we can make sure they work and are all useful. -- These are my opinions. I hate spam. ___ devel mailing list devel@ntpsec.org https://lists.ntpsec.org/mailman/listinfo/devel
Re: How does the parser work?
On Dec 4, 2023 13:49, James Browning wrote:The host phase of Waf build generates tablegen which in turn generates keywords.h IIRC. I have no idea how the internals work. I seem to recall that tablegen.c was badly scored by Codacy.Oops, keyword-gen and a rated; I need to get my memory replaced.___ devel mailing list devel@ntpsec.org https://lists.ntpsec.org/mailman/listinfo/devel
Re: How does the parser work?
On Dec 3, 2023 23:45, Hal Murray via devel wrote: ntp_parser.y contqains: %token T_Tinker %token T_Tlsciphers %token T_Tlsciphersuites I'd expect those tokens to come from the keywords header file. But tlsciphers isn't in the keyword list. tlscipehrswuites is in the list.The host phase of Waf build generates tablegen which in turn generates keywords.h IIRC. I have no idea how the internals work. I seem to recall that tablegen.c was badly scored by Codacy. ___ devel mailing list devel@ntpsec.org https://lists.ntpsec.org/mailman/listinfo/devel
How does the parser work?
ntp_parser.y contqains: %token T_Tinker %token T_Tlsciphers %token T_Tlsciphersuites I'd expect those tokens to come from the keywords header file. But tlsciphers isn't in the keyword list. tlscipehrswuites is in the list. -- These are my opinions. I hate spam. ___ devel mailing list devel@ntpsec.org https://lists.ntpsec.org/mailman/listinfo/devel