yumapro  23.10T-7
YumaPro SDK
Loading...
Searching...
No Matches
tk.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 - 2020, Andy Bierman, All Rights Reserved.
3 * Copyright (c) 2012 - 2021, YumaWorks, Inc., All Rights Reserved.
4 *
5 * Unless required by applicable law or agreed to in writing,
6 * software distributed under the License is distributed on an
7 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8 * KIND, either express or implied. See the License for the
9 * specific language governing permissions and limitations
10 * under the License.
11 */
12#ifndef _H_tk
13#define _H_tk
14
15/* FILE: tk.h
16*********************************************************************
17* *
18* P U R P O S E *
19* *
20*********************************************************************/
21
28/*********************************************************************
29* *
30* C H A N G E H I S T O R Y *
31* *
32*********************************************************************
33
34date init comment
35----------------------------------------------------------------------
3612-nov-05 abb Begun
37
38*/
39
40#include <xmlstring.h>
41
42#ifndef _H_dlq
43#include "dlq.h"
44#endif
45
46#ifndef _H_ncxtypes
47#include "ncxtypes.h"
48#endif
49
50#ifndef _H_xmlns
51#include "xmlns.h"
52#endif
53
54#ifdef __cplusplus
55extern "C" {
56#endif
57
58/********************************************************************
59* *
60* C O N S T A N T S *
61* *
62*********************************************************************/
63
76#define TK_BUFF_SIZE 0xffff
77
78
79
80 /******************** tk_token_t macros ******************/
81
82/* macros for quick processing of token chains
83 * All these macros take 1 parameter
84 * INPUTS:
85 * T == pointer to the tk_chain_t in progress
86 */
87
89#define TK_NEXT(T) ((tk_token_t *)dlq_nextEntry(T))
90
92#define TK_TYP(T) ((T)->typ)
93
95#define TK_ID(T) ((T)->typ==TK_TT_TSTRING || (T)->typ==TK_TT_MSTRING)
96
98#define TK_VAL(T) (T)->val
99
101#define TK_NSID(T) (T)->nsid
102
104#define TK_MOD(T) (T)->mod
105
107#define TK_ADV(T) \
108 ((T)->cur ? (((T)->cur = (tk_token_t *)dlq_nextEntry((T)->cur)) \
109 ? NO_ERR : ERR_NCX_EOF) : ERR_NCX_EOF)
110
112#define TK_BKUP(T) \
113 if (! ((T)->cur = (tk_token_t *)dlq_prevEntry((T)->cur))) \
114 (T)->cur = (tk_token_t *)(&((T)->tkQ))
115
116
117
118 /******************** tk_chain_t macros ******************/
119
120
122#define TK_CUR(T) ((T)->cur)
123
125#define TK_CUR_TYP(T) ((T)->cur->typ)
126
128#define TK_CUR_VAL(T) ((T)->cur->val)
129
131#define TK_CUR_LEN(T) ((T)->cur->len)
132
134#define TK_CUR_MOD(T) (T)->cur->mod
135
137#define TK_CUR_MODLEN(T) ((T)->cur->modlen)
138
140#define TK_CUR_STR(T) ((T)->cur->typ >= TK_TT_STRING && \
141 (T)->cur->typ <= TK_TT_SQSTRING)
142
144#define TK_TYP_STR(T) ((T) >= TK_TT_STRING && (T) <= TK_TT_SQSTRING)
145
147#define TK_CUR_NOWSTR(T) ((T)->cur->typ >= TK_TT_STRING && \
148 (T)->cur->typ <= TK_TT_SQSTRING)
149
151#define TK_CUR_NUM(T) ((T)->cur->typ==TK_TT_DNUM || \
152 (T)->cur->typ==TK_TT_HNUM || \
153 (T)->cur->typ==TK_TT_RNUM)
154
155
157#define TK_TYP_NUM(T) (((T) >= TK_TT_DNUM) && ((T) <= TK_TT_RNUM))
158
159
161#define TK_CUR_INUM(T) ((T)->cur->typ==TK_TT_DNUM || \
162 (T)->cur->typ==TK_TT_HNUM)
163
165#define TK_CUR_IQUAL(T) ((T)->cur->typ==TK_TT_QMARK || \
166 (T)->cur->typ==TK_TT_STAR || \
167 (T)->cur->typ==TK_TT_PLUS)
168
169
171#define TK_CUR_ID(T) ((T)->cur->typ==TK_TT_TSTRING || \
172 (T)->cur->typ==TK_TT_MSTRING)
173
175#define TK_CUR_SID(T) ((T)->cur->typ==TK_TT_SSTRING || \
176 (T)->cur->typ==TK_TT_MSSTRING)
177
179#define TK_CUR_LNUM(T) ((T)->cur->linenum)
180
182#define TK_CUR_LPOS(T) ((T)->cur->linepos)
183
188#define TK_CUR_TEXT(T) (((T)->cur->typ == TK_TT_STRING) || \
189 ((T)->cur->typ >= TK_TT_SSTRING && \
190 (T)->cur->typ <= TK_TT_RNUM))
191
192
194#define TK_CUR_NSID(T) (T)->cur->nsid
195
197#define TK_DOCMODE(TKC) ((TKC)->flags & TK_FL_DOCMODE)
198
200#define TK_HAS_ORIGTK(TK) (((TK)->typ == TK_TT_QSTRING || \
201 (TK)->typ == TK_TT_SQSTRING) && \
202 (TK)->origval != NULL)
203
205#define TK_SET_ESCERR(TK) (TK)->flags |= TK_FL_ESCSTR_ERR
206
208#define TK_GET_ESCERR(TK) ((TK)->flags & TK_FL_ESCSTR_ERR)
209
210
217#define TK_FL_REDO bit0
218
225#define TK_FL_MALLOC bit1
226
233#define TK_FL_DOCMODE bit2
234
235
242#define TK_FL_BINARYMODE bit3
243
244
250#define TK_FL_ESCSTR_ERR bit4
251
252
253
259#define TK_FL_VAL_MALLOC bit0
260
261
266#define TK_FL_ORIGVAL_MALLOC bit1
267
268
269#define TK_VALBUFF_LEN 8
270
271
272/********************************************************************
273* *
274* T Y P E S *
275* *
276*********************************************************************/
277
279typedef enum tk_type_t_ {
280 TK_TT_NONE,
281 /* PUT ALL 1-CHAR TOKENS FIRST */
302 /* PUT ALL 2-CHAR TOKENS SECOND */
311 /* PUT ALL STRING CLASSIFICATION TOKENS THIRD */
326 /* PUT ALL NUMBER CLASSIFICATION TOKENS FOURTH */
331 /* PUT ALL SPECIAL CASE TOKENS LAST */
334
335
337typedef enum tk_source_t_ {
345 TK_SOURCE_CLI
347
348
350typedef enum tk_origstr_typ_t_ {
351 TK_ORIGSTR_NONE,
357
358
363typedef struct tk_origstr_t_ {
364 dlq_hdr_t qhdr;
366 xmlChar *str;
368
369
371typedef struct tk_token_t_ {
372 dlq_hdr_t qhdr;
374 xmlChar *mod;
375 uint32 modlen;
376 xmlChar *val;
377 xmlChar *origval;
378 uint32 len;
379 uint32 linenum;
380 uint32 linepos;
382 dlq_hdr_t origstrQ;
383 xmlChar valbuff[TK_VALBUFF_LEN];
384 uint8 flags;
385} tk_token_t;
386
387
391typedef struct tk_token_ptr_t_ {
392 dlq_hdr_t qhdr;
394 const void *field;
396
397
407typedef status_t
408 (*tk_getline_fn_t) (xmlChar *fillbuff,
409 uint32 fillbuffsize,
410 void *cookie);
411
412
413
415typedef struct tk_chain_t_ {
416 dlq_hdr_t qhdr;
417 dlq_hdr_t tkQ;
418 dlq_hdr_t tkptrQ;
422 const xmlChar *filename;
423 FILE *fp;
424 xmlChar *buff;
425 xmlChar *bptr;
426 uint32 linenum;
427 uint32 linepos;
428 uint32 flags;
431 void *cookie;
432 xmlChar escerr_ch;
433} tk_chain_t;
434
435
436/********************************************************************
437* *
438* F U N C T I O N S *
439* *
440*********************************************************************/
441
442
448extern tk_chain_t *
449 tk_new_chain (void);
450
451
459extern void
461 FILE *fp,
462 const xmlChar *filename);
463
464
472extern void
474 xmlChar *line);
475
476
486extern void
488 xmlChar *str);
489
496extern void
498 xmlChar *str);
499
500
508extern void
510 FILE *fp,
511 const xmlChar *filename);
512
513
520extern void
522 const xmlChar *filename);
523
524
532extern void
534 FILE *fp,
535 const xmlChar *filename);
536
537
544extern void
546 xmlChar *buff);
547
548
556extern void
558 tk_getline_fn_t getline_fn,
559 void *cookie);
560
561
567extern void
569
570
577extern void
579 xmlChar *str);
580
581
587extern void
589
590
599extern ncx_btype_t
600 tk_get_yang_btype_id (const xmlChar *buff,
601 uint32 len);
602
603
610extern const char *
612
613
620extern const char *
622
623
630extern const char *
632
633
640extern tk_type_t
641 tk_next_typ (tk_chain_t *tkc);
642
643
650extern tk_type_t
652
653
660extern boolean
662
663
670extern const xmlChar *
671 tk_next_val (tk_chain_t *tkc);
672
673
680extern void
681 tk_dump_token (const tk_token_t *tk);
682
683
690extern void
691 tk_dump_chain (const tk_chain_t *tkc);
692
693
701extern boolean
702 tk_is_wsp_string (const tk_token_t *tk);
703
704
734extern status_t
736 ncx_module_t *mod);
737
738
749extern status_t
751 ncx_module_t *mod);
752
753
765extern tk_chain_t *
767 xmlChar *str,
768 status_t *res);
769
770
783extern tk_chain_t *
785 xmlChar *str,
786 uint32 curlinenum,
787 uint32 curlinepos,
788 status_t *res);
789
790
797extern uint32
798 tk_token_count (const tk_chain_t *tkc);
799
800
806extern void
808
809
818extern tk_chain_t *
819 tk_clone_chain (tk_chain_t *oldtkc);
820
821
829extern status_t
831 const xmlChar *valstr);
832
833
844extern status_t
846 const xmlChar *prefix,
847 uint32 prefixlen,
848 const xmlChar *valstr);
849
850
858extern status_t
860 const xmlChar *valstr);
861
862
869extern status_t
871
872
879extern status_t
881
882
889extern status_t
891
892
902extern status_t
904 tk_token_t *tk,
905 const void *field);
906
907
924extern const xmlChar *
926 boolean *dquote,
927 boolean *morestr);
928
929
936extern const tk_origstr_t *
938
939
946extern const tk_origstr_t *
947 tk_next_origstr_rec (const tk_origstr_t *origstr);
948
949
965extern const xmlChar *
966 tk_get_origstr_parts (const tk_origstr_t *origstr,
967 boolean *dquote,
968 boolean *newline);
969
970
978extern const tk_token_ptr_t *
979 tk_find_tkptr (const tk_chain_t *tkc,
980 const void *field);
981
982
990extern uint32
991 tk_tkptr_quotes (const tk_token_ptr_t *tkptr);
992
993
1000extern boolean
1001 tk_cur_is_first (const tk_chain_t *tkc);
1002
1003
1007#ifdef __cplusplus
1008} /* end extern 'C' */
1009#endif
1010
1011#endif /* _H_tk */
dlq provides general double-linked list and queue support:
status_t
global error return code
Definition: status_enum.h:210
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
ncx_btype_t
enumeration of the built-in NCX types These types cannot be overridden and cannot be imported
Definition: ncxtypes.h:213
status_t tk_add_rbrace_token(tk_chain_t *tkc)
Allocatate a new right brace token and add it to the parse chain.
Definition: tk.c:4348
status_t tk_add_pid_token(tk_chain_t *tkc, const xmlChar *prefix, uint32 prefixlen, const xmlChar *valstr)
Allocatate a new prefixed ID token and add it to the parse chain.
Definition: tk.c:4220
tk_chain_t * tk_new_chain(void)
Allocatate a new token parse chain.
Definition: tk.c:2944
const char * tk_get_btype_sym(ncx_btype_t btyp)
Get the symbolic token symbol for one of the base types.
Definition: tk.c:3369
void tk_setup_chain_conf(tk_chain_t *tkc, FILE *fp, const xmlChar *filename)
Setup a previously allocated chain for a text config file.
Definition: tk.c:2970
status_t tk_check_save_origstr(tk_chain_t *tkc, tk_token_t *tk, const void *field)
Check the docmode and the specified token; Save a tk_origptr_t if needed with the field address.
Definition: tk.c:4421
void tk_setup_chain_json_buffs(tk_chain_t *tkc, tk_getline_fn_t getline_fn, void *cookie)
Setup a previously allocated chain for a JSON buffer chain.
Definition: tk.c:3177
tk_chain_t * tk_clone_chain(tk_chain_t *oldtkc)
Allocatate and a new token parse chain and fill it with the specified token chain contents.
Definition: tk.c:4109
void tk_setup_chain_docmode(tk_chain_t *tkc)
Setup a previously allocated chain for a yangdump docmode output.
Definition: tk.c:3202
tk_origstr_typ_t
preserve the original string type
Definition: tk.h:350
status_t tk_add_lbrace_token(tk_chain_t *tkc)
Allocatate a new left brace token and add it to the parse chain.
Definition: tk.c:4313
const char * tk_get_token_sym(tk_type_t ttyp)
Get the symbolic token symbol.
Definition: tk.c:3347
status_t(* tk_getline_fn_t)(xmlChar *fillbuff, uint32 fillbuffsize, void *cookie)
callback function to read a line into a buffer
Definition: tk.h:408
tk_chain_t * tk_tokenize_metadata_string(ncx_module_t *mod, xmlChar *str, status_t *res)
The specified ncx:metadata string is parsed into tokens convert the ncx:metadata content to 1 or 2 to...
Definition: tk.c:3978
void tk_dump_token(const tk_token_t *tk)
Debug printf the specified token !!! Very verbose !!!
Definition: tk.c:3537
uint32 tk_token_count(const tk_chain_t *tkc)
Get the number of tokens in the queue.
Definition: tk.c:4061
const xmlChar * tk_get_first_origstr(const tk_token_ptr_t *tkptr, boolean *dquote, boolean *morestr)
Get the first original string to use.
Definition: tk.c:4469
uint32 tk_tkptr_quotes(const tk_token_ptr_t *tkptr)
Get the specified token pointer record token ID type Use the first string or only string.
Definition: tk.c:4626
status_t tk_retokenize_cur_string(tk_chain_t *tkc, ncx_module_t *mod)
The current token is some sort of a string Reparse it according to the full YANG token list,...
Definition: tk.c:3907
const tk_token_ptr_t * tk_find_tkptr(const tk_chain_t *tkc, const void *field)
Find the specified token pointer record.
Definition: tk.c:4588
ncx_btype_t tk_get_yang_btype_id(const xmlChar *buff, uint32 len)
Check if the specified string is a YANG builtin type name checks for valid YANG data type name.
Definition: tk.c:3284
const xmlChar * tk_next_val(tk_chain_t *tkc)
Get the token type of the next token.
Definition: tk.c:3511
boolean tk_cur_is_first(const tk_chain_t *tkc)
Check if the current token is the first token.
Definition: tk.c:4656
void tk_setup_chain_feature(tk_chain_t *tkc, xmlChar *str)
Setup a previously allocated chain for 'if-feature' YANG 1.1.
Definition: tk.c:3050
status_t tk_tokenize_input(tk_chain_t *tkc, ncx_module_t *mod)
Parse the input (FILE or buffer) into tk_token_t structs.
Definition: tk.c:3680
void tk_setup_chain_cli(tk_chain_t *tkc, xmlChar *line)
Setup a previously allocated chain for a CLI command line.
Definition: tk.c:2997
status_t tk_add_semicol_token(tk_chain_t *tkc)
Allocatate a new semi-colon token and add it to the parse chain.
Definition: tk.c:4383
const xmlChar * tk_get_origstr_parts(const tk_origstr_t *origstr, boolean *dquote, boolean *newline)
Get the fields from the original string record.
Definition: tk.c:4556
boolean tk_is_wsp_string(const tk_token_t *tk)
Check if the current token is a string with whitespace in it.
Definition: tk.c:3623
tk_chain_t * tk_tokenize_xpath_string(ncx_module_t *mod, xmlChar *str, uint32 curlinenum, uint32 curlinepos, status_t *res)
The specified XPath string is parsed into tokens.
Definition: tk.c:4022
void tk_reset_chain(tk_chain_t *tkc)
Reset the token chain current pointer to the start.
Definition: tk.c:4084
const tk_origstr_t * tk_first_origstr_rec(const tk_token_ptr_t *tkptr)
Get the first tk_origstr_t struct (if any)
Definition: tk.c:4502
void tk_free_chain(tk_chain_t *tkc)
Cleanup and deallocate a tk_chain_t.
Definition: tk.c:3248
boolean tk_next_is_null(tk_chain_t *tkc)
Get the special sequence [null] is next.
Definition: tk.c:3456
const char * tk_get_token_name(tk_type_t ttyp)
Get the symbolic token name.
Definition: tk.c:3325
void tk_setup_chain_yang(tk_chain_t *tkc, FILE *fp, const xmlChar *filename)
Setup a previously allocated chain for a YANG file.
Definition: tk.c:3076
status_t tk_add_string_token(tk_chain_t *tkc, const xmlChar *valstr)
Allocatate a new string token and add it to the parse chain.
Definition: tk.c:4261
tk_type_t
different types of tokens parsed during 1st pass
Definition: tk.h:279
void tk_setup_chain_json_buffer(tk_chain_t *tkc, xmlChar *buff)
Setup a previously allocated chain for a JSON buffer.
Definition: tk.c:3153
const tk_origstr_t * tk_next_origstr_rec(const tk_origstr_t *origstr)
Get the next tk_origstr_t struct (if any)
Definition: tk.c:4526
tk_type_t tk_next_typ(tk_chain_t *tkc)
Get the token type of the next token.
Definition: tk.c:3394
status_t tk_add_id_token(tk_chain_t *tkc, const xmlChar *valstr)
Allocatate a new ID token and add it to the parse chain.
Definition: tk.c:4174
void tk_setup_chain_json_file(tk_chain_t *tkc, FILE *fp, const xmlChar *filename)
Setup a previously allocated chain for a JSON input stream.
Definition: tk.c:3127
void tk_dump_chain(const tk_chain_t *tkc)
Debug printf the token chain !!! Very verbose !!!
Definition: tk.c:3575
tk_source_t
token source context
Definition: tk.h:337
void tk_setup_chain_yin(tk_chain_t *tkc, const xmlChar *filename)
Setup a previously allocated chain for a YIN file.
Definition: tk.c:3102
tk_type_t tk_next_typ2(tk_chain_t *tkc)
Get the token type of the token after the next token.
Definition: tk.c:3421
void tk_setup_chain_cli_line(tk_chain_t *tkc, xmlChar *str)
Setup a previously allocated chain for yangcli CLI line of input.
Definition: tk.c:3223
void tk_setup_chain_fields(tk_chain_t *tkc, xmlChar *str)
Setup a previously allocated chain for 'fields' RESTCONF query parameter str value.
Definition: tk.c:3025
@ TK_ORIGSTR_SQUOTE
single quote
Definition: tk.h:354
@ TK_ORIGSTR_DQUOTE
double quote
Definition: tk.h:352
@ TK_ORIGSTR_DQUOTE_NL
souble quote + newline
Definition: tk.h:353
@ TK_ORIGSTR_SQUOTE_NL
single quote + newline
Definition: tk.h:355
@ TK_TT_LPAREN
left paren '('
Definition: tk.h:285
@ TK_TT_LT
less than char '<'
Definition: tk.h:299
@ TK_TT_VARBIND
XPath varbind '$NCName'.
Definition: tk.h:321
@ TK_TT_PLUS
plus mark '+'
Definition: tk.h:294
@ TK_TT_RBRACE
right brace '}'
Definition: tk.h:283
@ TK_TT_STAR
star '*'
Definition: tk.h:292
@ TK_TT_NOTEQUAL
not equal '!='
Definition: tk.h:306
@ TK_TT_RANGESEP
range sep, parent node '..'
Definition: tk.h:303
@ TK_TT_SSTRING
scoped token string
Definition: tk.h:314
@ TK_TT_LBRACK
left bracket '['
Definition: tk.h:287
@ TK_TT_COMMA
comma ','
Definition: tk.h:289
@ TK_TT_EQUAL
equal sign '='
Definition: tk.h:290
@ TK_TT_NCNAME_STAR
XPath NCName:* sequence.
Definition: tk.h:324
@ TK_TT_PERIOD
period char '.
Definition: tk.h:296
@ TK_TT_LEQUAL
less than or equal '<='
Definition: tk.h:307
@ TK_TT_GEQUAL
greater than or equal '>='
Definition: tk.h:308
@ TK_TT_GT
greater than char '>'
Definition: tk.h:300
@ TK_TT_SQSTRING
single quoted string
Definition: tk.h:319
@ TK_TT_RBRACK
right bracket ']'
Definition: tk.h:288
@ TK_TT_FSLASH
forward slash char '/'
Definition: tk.h:297
@ TK_TT_COLON
colon char ':'
Definition: tk.h:295
@ TK_TT_BAR
bar '|'
Definition: tk.h:291
@ TK_TT_MSSTRING
module-qualified scoped string
Definition: tk.h:317
@ TK_TT_STRING
unquoted string
Definition: tk.h:312
@ TK_TT_DBLCOLON
2 colon chars '::'
Definition: tk.h:304
@ TK_TT_QSTRING
double quoted string
Definition: tk.h:318
@ TK_TT_MSTRING
module-qualified token string
Definition: tk.h:316
@ TK_TT_MINUS
minus char '-'
Definition: tk.h:298
@ TK_TT_DBLFSLASH
2 fwd slashes '//'
Definition: tk.h:305
@ TK_TT_RNUM
real number
Definition: tk.h:329
@ TK_TT_HNUM
hex number
Definition: tk.h:328
@ TK_TT_LBRACE
left brace '{'
Definition: tk.h:282
@ TK_TT_QVARBIND
XPath varbind '$prefix:NCName'.
Definition: tk.h:322
@ TK_TT_DNUM
decimal number
Definition: tk.h:327
@ TK_TT_ATSIGN
at sign '@'
Definition: tk.h:293
@ TK_TT_TSTRING
token string
Definition: tk.h:315
@ TK_TT_NEWLINE
is significant in conf files
Definition: tk.h:332
@ TK_TT_LINE
raw command line
Definition: tk.h:313
@ TK_TT_RPAREN
right paren ')'
Definition: tk.h:286
@ TK_TT_SEMICOL
semi-colon ';'
Definition: tk.h:284
@ TK_SOURCE_JSON
JSON.
Definition: tk.h:342
@ TK_SOURCE_YANG
YANG.
Definition: tk.h:339
@ TK_SOURCE_XPATH
XPath.
Definition: tk.h:340
@ TK_SOURCE_FIELDS
RESTCONF fields parameter.
Definition: tk.h:343
@ TK_SOURCE_FEATURE
YANG 1.1 feature expr.
Definition: tk.h:344
@ TK_SOURCE_REDO
redo internal mode
Definition: tk.h:341
@ TK_SOURCE_CONF
config file
Definition: tk.h:338
YANG module data structures Many internal representations of YANG module constructs.
struct to remember error info tkc->cur_err will be checked before tkc->cur for error information
Definition: ncxtypes.h:873
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1134
token parsing chain (main parser control block)
Definition: tk.h:415
xmlChar * buff
buffer when source is buffer
Definition: tk.h:424
uint32 linepos
current line position
Definition: tk.h:427
dlq_hdr_t qhdr
queue header
Definition: tk.h:416
void * cookie
getline callback cookie
Definition: tk.h:431
const xmlChar * filename
filename when source is file
Definition: tk.h:422
tk_getline_fn_t getline_fn
getline callback
Definition: tk.h:430
uint32 flags
parser state flags
Definition: tk.h:428
dlq_hdr_t tkQ
Q of tk_token_t.
Definition: tk.h:417
tk_token_t * escerr_tk
backptr into tkQ
Definition: tk.h:420
xmlChar * bptr
current read buffer pointer
Definition: tk.h:425
dlq_hdr_t tkptrQ
Q of tk_token_ptr_t.
Definition: tk.h:418
FILE * fp
file when source is file
Definition: tk.h:423
tk_token_t * cur
current token pointer
Definition: tk.h:419
uint32 linenum
current line number
Definition: tk.h:426
xmlChar escerr_ch
first bad escaped char if escerr
Definition: tk.h:432
ncx_error_t * curerr
error token pointer
Definition: tk.h:421
tk_source_t source
source context
Definition: tk.h:429
each entry in the origstrQ is the 2nd through Nth string to be concated.
Definition: tk.h:363
tk_origstr_typ_t origtyp
original source type
Definition: tk.h:365
dlq_hdr_t qhdr
queue header
Definition: tk.h:364
xmlChar * str
original string
Definition: tk.h:366
token backptr to get at original token chain for strings used only by yangdump –format=yang|html
Definition: tk.h:391
const void * field
saved cookie
Definition: tk.h:394
dlq_hdr_t qhdr
queue header
Definition: tk.h:392
tk_token_t * tk
token
Definition: tk.h:393
single YANG language token type
Definition: tk.h:371
dlq_hdr_t origstrQ
Q of tk_origstr_t only used in DOCMODE.
Definition: tk.h:382
uint32 linepos
token source line osition
Definition: tk.h:380
dlq_hdr_t qhdr
queue header
Definition: tk.h:372
uint32 len
length of value
Definition: tk.h:378
xmlChar * origval
used in DOCMODE for yangdump
Definition: tk.h:377
uint32 modlen
length of 'mod'; not Z-string!
Definition: tk.h:375
tk_type_t typ
token type
Definition: tk.h:373
xmlChar * mod
only used if prefix found
Definition: tk.h:374
uint32 linenum
token source line number
Definition: tk.h:379
uint8 flags
parsing state flags
Definition: tk.h:384
xmlChar * val
value string for token if buffer too snall
Definition: tk.h:376
xmlns_id_t nsid
only used for TK_TT_MSTRING tokens
Definition: tk.h:381
XML namespace support.