potion  0.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ast.c File Reference

the ast for Potion code in-memory implements PNSource More...

#include <stdio.h>
#include <stdlib.h>
#include "potion.h"
#include "internal.h"
#include "ast.h"
+ Include dependency graph for ast.c:

Go to the source code of this file.

Functions

PN potion_source (Potion *P, u8 p, PN a, PN b, PN c, int lineno, PN line)
 PNSource constructor. More...
 
void potion_source_init (Potion *P)
 

Variables

const char * potion_ast_names []
 
const int potion_ast_sizes []
 

Detailed Description

the ast for Potion code in-memory implements PNSource

Definition in file ast.c.

Function Documentation

PN potion_source ( Potion P,
u8  p,
PN  a,
PN  b,
PN  c,
int  lineno,
PN  line 
)

PNSource constructor.

Parameters
pAST type
a,b,cAST operands
linenolinenumber in src file
lineassociated line PNString in src file
Returns
a new AST node with up to three operands

Definition at line 35 of file ast.c.

void potion_source_init ( Potion P)

Definition at line 157 of file ast.c.

Variable Documentation

const char* potion_ast_names[]
Initial value:
= {
"code", "value", "assign", "not", "or", "and", "cmp", "eq", "neq",
"gt", "gte", "lt", "lte", "pipe", "caret", "amp", "wavy", "bitl",
"bitr", "plus", "minus", "inc", "times", "div", "rem", "pow",
"msg", "path", "query", "pathq", "expr", "list", "block", "lick",
"proto", "debug"
}
See also
potion.h: enum PN_AST

Definition at line 13 of file ast.c.

const int potion_ast_sizes[]
Initial value:
= {
1, 3, 2, 1, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 1, 2,
2, 2, 2, 2, 2, 2, 2, 2,
3, 1, 1, 1, 1, 1, 1, 3,
2, 3
}

Definition at line 21 of file ast.c.