#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <string.h>
#include <inttypes.h>
#include <stdint.h>
#include "m_token.h"
#include "m_ms.h"
Defines | |
#define | MY_LL "ll" |
Functions | |
sGcCtx * | generate_gc (void) |
void | release_gc (sGcCtx *gc) |
uMToken * | gen_tok (sGcCtx *gc, enum eMToken kind, enum eMSToken subkind, size_t addend) |
void | dump_tok (FILE *fp, uMToken *p) |
uMToken * | chain_tok (uMToken *l, uMToken *add) |
uMToken * | gen_value (sGcCtx *gc, enum eMSToken skind, uint64_t val, int is_signed, int size) |
uMToken * | gen_name (sGcCtx *gc, enum eMSToken skind, const char *name) |
uMToken * | gen_dim (sGcCtx *gc, enum eMSToken skind, uint64_t val, const char *non_tt_param, int fSigned, int fNegate) |
uMToken * | gen_unary (sGcCtx *gc, enum eMSToken skind, uMToken *un) |
uMToken * | gen_binary (sGcCtx *gc, enum eMSToken skind, uMToken *l, uMToken *r) |
char * | sprint_decl (uMToken *r) |
void | print_decl (FILE *fp, uMToken *r) |
#define MY_LL "ll" |
Chains uMTokens together.
[in] | l | uMtoken chain to link up with. |
[in] | add | uMtoken to add to chain. |
void dump_tok | ( | FILE * | fp, | |
uMToken * | p | |||
) |
Generates a binary node token.
[in] | gc | Pointer to garbage collection context. |
[in] | skind | Token subKind. |
[in] | l | Left node element. |
[in] | r | Right node element. |
uMToken* gen_dim | ( | sGcCtx * | gc, | |
enum eMSToken | skind, | |||
uint64_t | val, | |||
const char * | non_tt_param, | |||
int | fSigned, | |||
int | fNegate | |||
) |
Constructs a "dim" kind token.
[in] | gc | Pointer to garbage collection context. |
[in] | skind | Token subkind. |
[in] | val | Token numerical value. |
[in] | non_tt_param | pointer to decoded C++ template name. |
[in] | fSigned | Signedness of the numerical value. |
[in] | fNegate | 1 for "val" is negative digit. |
Constructs a "name" kind token.
[in] | gc | Pointer to garbage collection context. |
[in] | skind | Token subkind. |
[in] | name | Pointer to name string. |
gen_tok constructs uMToken instances Instances are destroyed with release_gc().
[in] | gc | Pointer to garbage collection context. |
[in] | kind | Kind of token to construct |
[in] | subkind | Subkind of token to construct |
[in] | addend | Additional byte padding at the end. |
Constructs a "unary" kind token.
[in] | gc | Pointer to garbage collection context. |
[in] | skind | Token subkind. |
[in] | un | Pointer to leaf element. |
Constructs a "value" kind token.
[in] | gc | Pointer to garbage collection context. |
[in] | skind | Token subkind. |
[in] | val | Sets the value on token, |
[in] | is_signed | Signed bit of val. |
[in] | size | Width of val. |
sGcCtx* generate_gc | ( | void | ) |
void print_decl | ( | FILE * | fp, | |
uMToken * | p | |||
) |
Prints C++ name to file descriptor.
[in] | fp | Output file descriptor. |
[in] | p | Token containing information about the C++ name. |
void release_gc | ( | sGcCtx * | gc | ) |
Releases memory tracked by context.
[in] | gc | Garbage collection context to work on. |
char* sprint_decl | ( | uMToken * | r | ) |
Get pointer to decoded C++ name string. Use free() to release returned string.
[in] | r | C++ name token. |