My Project
Loading...
Searching...
No Matches
ast_getter.h File Reference

: helper structure to get an AST More...

Go to the source code of this file.

Data Structures

struct  Comment
 
struct  AstGetter_
 

Typedefs

typedef struct Comment Comment
 
typedef struct AstGetter_ AstGetter
 

Enumerations

enum  comment_t { comment_normal , comment_after , comment_before }
 

Functions

ANN Ast parse_pos (struct AstGetter_ *const, const pos_t)
 
static ANN Ast parse (struct AstGetter_ *const arg)
 

Detailed Description

: helper structure to get an AST

Definition in file ast_getter.h.

Typedef Documentation

◆ AstGetter

typedef struct AstGetter_ AstGetter

◆ Comment

typedef struct Comment Comment

Enumeration Type Documentation

◆ comment_t

enum comment_t
Enumerator
comment_normal 
comment_after 
comment_before 

Definition at line 7 of file ast_getter.h.

7 {
11} comment_t;
comment_t
Definition ast_getter.h:7
@ comment_normal
Definition ast_getter.h:8
@ comment_after
Definition ast_getter.h:9
@ comment_before
Definition ast_getter.h:10

Function Documentation

◆ parse()

static ANN Ast parse ( struct AstGetter_ *const arg)
inlinestatic

Definition at line 31 of file ast_getter.h.

31 {
32 pos_t pos;
33 pos_ini(&pos);
34 return parse_pos(arg, pos);
35}
ANN Ast parse_pos(struct AstGetter_ *const, const pos_t)
Definition scanner.c:36
ANN void pos_ini(pos_t *pos)
Definition gwlog.c:11
Definition gwlog.h:7

◆ parse_pos()

ANN Ast parse_pos ( struct AstGetter_ * const arg,
const pos_t pos )

Definition at line 36 of file scanner.c.

36 {
37 Scanner * s = new_scanner(arg);
38 s->pos = pos;
39 const Ast ast = get_ast(arg->ppa->hash.p, s);
40 free_scanner(s);
41 return ast;
42}
struct SectionList * Ast
Definition absyn.h:23
static ANEW Scanner * new_scanner(AstGetter *arg)
Definition scanner.c:8
static ANN void free_scanner(Scanner *scan)
Definition scanner.c:23
static ANN Ast get_ast(MemPool mp, Scanner *s)
Definition scanner.c:30
PPArg * ppa
Definition ast_getter.h:25
struct Hash_ hash
Definition pparg.h:9
struct pos_t pos
Definition scanner.h:13