---
name: "wn_parse_literal_id"
section: "3"
platform: "linux"
package: "libwn-dev"
version: "6.0-17"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/wnptok"
---

# wn\_parse\_literal\_id(3)

parse stuff

Part of [wnptok(3)](/wnptok/3.md).

## NAME

wn\_parse\_recursive\_comment, wn\_parse\_literal, wn\_parse\_literal\_id, wn\_copy\_between\_marks\_to\_string, wn\_parse\_literal\_general\_id, wn\_between\_marks\_equal\_string, wn\_parse\_id, wn\_write\_between\_marks, wn\_parse\_numeric\_id, wn\_parse\_general\_id, wn\_parse\_int, wn\_parse\_double, wn\_parse\_quoted\_string, wn\_parse\_empty, wn\_parse\_eos, wn\_parse\_char, wn\_parse\_literal\_char, wn\_parse\_char\_of\_type, wn\_parse\_blanks, wn\_parse\_blanks\_with\_std\_comments, wn\_parse\_blanks\_with\_comments, wn\_parse\_standard\_comment, wn\_parse\_simple\_comment - parse stuff

## SYNOPSIS

```
#include <wn/wncstr.h>

bool wn_parse_empty(stream)
wn_cstream stream;

bool wn_parse_eos(stream)
wn_cstream stream;

bool wn_parse_char(stream,&c)
wn_cstream stream;
char c;

bool wn_parse_literal_char(stream,c)
wn_cstream stream;
char c;

bool wn_parse_char_of_type(stream,&c,char_type)
wn_cstream stream;
char c,char_type[256];

bool wn_parse_blanks(stream,num)
wn_cstream stream;
int num;

bool wn_parse_blanks_with_std_comments(stream,num)
wn_cstream stream;
int num;

bool wn_parse_blanks_with_comments(stream,pparse_comment,num)
wn_cstream stream;
bool (*pparse_comment)(/*stream*/);
int num;

bool wn_parse_standard_comment(stream)
wn_cstream stream;

bool wn_parse_simple_comment(stream,start_comment,fin_comment)
wn_cstream stream;
char start_comment[],fin_comment[];

bool wn_parse_recursive_comment(stream,start_comment,fin_comment)
wn_cstream stream;
char start_comment[],fin_comment[];

bool wn_parse_literal(stream,literal)
wn_cstream stream;
char literal[];

bool wn_parse_literal_id(stream,id)
wn_cstream stream;
char id[];

bool wn_parse_literal_general_id(stream,begin_id_char_type,
id_char_type,id)
wn_cstream stream;
char begin_id_char_type[256],id_char_type[256];
char id[];

bool wn_parse_id(stream,&id)
wn_cstream stream;
char id[];

bool wn_parse_numeric_id(stream,&id)
wn_cstream stream;
char id[];

bool wn_parse_general_id(stream,begin_id_char_type,id_char_type,&id)
wn_cstream stream;
char begin_id_char_type[256],id_char_type[256];
char id[];

bool wn_parse_int(stream,&i)
wn_cstream stream;
int i;

bool wn_parse_double(stream,&f)
wn_cstream stream;
double f;

bool wn_parse_quoted_string(stream,start_char,&string,fin_char)
wn_cstream stream;
char start_char,fin_char;
char string[];

wn_copy_between_marks_to_string(string,stream,start_mark,fin_mark)
char string[];
wn_cstream stream;
int start_mark,fin_mark;

bool wn_between_marks_equal_string(string,stream,start_mark,fin_mark)
char string[];
wn_cstream stream;
int start_mark,fin_mark;

wn_write_between_marks(out_stream,stream,start_mark,fin_mark)
wn_cstream out_stream,stream;
int start_mark,fin_mark;
```

## DESCRIPTION

These routines parse for the indicated object. If the parse is successful, the current mark is placed after the object and TRUE is returned.  Otherwise, FALSE is returned and the current mark is unaltered.

**wn\_parse\_empty** parses the empty string.  It always succeeds.

**wn\_parse\_eos** returns *TRUE* if the current mark is at end of *stream*. It returns *FALSE* otherwise.

**wn\_parse\_char** parses a char from *stream*.  This char is placed  in *c*.  It succeeds unless current mark is at end of *stream*.

**wn\_parse\_literal\_char** attempts to parse Ic **as the next char** **in** *stream***.**

**wn\_parse\_char\_of\_type attempts to parse the next char in** *stream* **as a char of a class defined by** *char\_type***.  If wn\_parse\_char\_of\_type** **finds a char and** *char\_type***\[c\] == TRUE it succeeds; otherwise it fails.**

**wn\_parse\_blanks attempts to parse** *num* **or more blanks.**

**wn\_parse\_blanks\_with\_std\_comments attempts to parse blanks mixed with** **comments.**  *num* **or more chars must be parsed for success.**   **wn\_parse\_standard\_\_comment is the subroutine used to parse the** **comments.**

**wn\_parse\_blanks\_with\_comments attempts to parse blanks mixed with** **comments.**  *num* **or more chars must be parsed for success.**   **\****pparse\_comment* **is a subroutine to parse the comments,** **usually set to wn\_parse\_standard\_comment.**

**wn\_parse\_standard\_comment attempts to parse a comment delimited** **by /\* and \*/ .  Such comments may be nested.**

**wn\_parse\_simple\_comment attempts to parse a comment delimited** **by the strings in** *start\_comment* **and** *fin\_comment***.  Nested comments** **are not permitted.**

**wn\_parse\_recursive\_comment attempts to parse a comment delimited** **by the strings in** *start\_comment* **and** *fin\_comment***.  Nested comments** **are permitted.**

**wn\_parse\_literal attempts to parse the** *string* **in** *literal***.**

**wn\_parse\_literal\_id attempts to parse an identifier of the** **style parsed by wn\_parse\_id.  It succeeds iff it parses an**  **identifier AND this identifier matches** *id***.**

**wn\_parse\_literal\_general\_id attempts to parse an identifier of the** **style parsed by wn\_parse\_general\_id.  It succeeds iff it parses an**  **identifier AND this identifier matches** *id***.**

**wn\_parse\_id attempts to parse an identifier.  If successful,** **the result is placed in** *id***.  The identifier must begin with a** **letter or underscore character ('\_').  Its body consists of** **letters, numbers, or underscores.  No limit is placed on its length.** **Memory for** *id* **is allocated from the current memory group.**

**wn\_parse\_numeric\_id attempts to parse an identifier.  If successful,** **the result is placed in** *id***.  Its beginning and body consists of** **letters, numbers, or underscores.  No limit is placed on its length.** **Memory for** *id* **is allocated from the current memory group.**

**wn\_parse\_general\_id attempts to parse an identifier.  If successful,** **the result is placed in** *id***.  The identifier must begin with a** **character from the class** *begin\_id\_char\_type***.  Its body consists of** **characters from the class** *id\_char\_type***.  A character c belongs to** **a class iff class\[c\] == TRUE.  No limit is placed on the indentifier's** **length.  Memory for** *id* **is allocated from the current memory group.**

**wn\_parse\_int attempts to parse a signed integer.  If successful,** **the integer is placed in** *i***.**

**wn\_parse\_double attempts to parse a signed double-precision** **floating point number.  If successful, the number is placed in** *f***.**

**wn\_parse\_quoted\_string attempts to parse a quoted string.**   **If successful, the result is placed in** *string***.** **Memory for** *string* **is allocated from the current memory group.** **The beginning of the quoted string is delimited by the character** *start\_char***, the end by the character** *fin\_char***.**

**wn\_copy\_between\_marks\_to\_string copies characters of** *stream* **between** *start\_mark* **(inclusive) and** *fin\_mark* **(exclusive) into** *string***.**  *string* **must be of length** *fin\_mark***-***start\_mark***+1 (1 for** **the ' ' terminator).  Memory for** *string* **must be allocated by** **the caller.**

**wn\_between\_marks\_equal\_string tests whether characters of** *stream* **between** *start\_mark* **(inclusive) and** *fin\_mark* **(exclusive) match** **those in** *string***.**

**wn\_write\_between\_marks writes characters of** *stream* **between** *start\_mark* **(inclusive) and** *fin\_mark* **(exclusive) into** **the** *out\_stream***.**

## SEE ALSO

**wnwtok, wnscan, wncstr**

## AUTHOR

**Will Naylor**
