WONKY



LOG | FILES | OVERVIEW


#ifndef WONKY_PARSE_EXPR_H
#define WONKY_PARSE_EXPR_H WONKY_PARSE_EXPR_H
#include <automata.h>
#include <queue.h>
#include <lexer.h>
#include <parse_declaration.h>
#include <ast.h>
#include <limits.h>
#include <value.h>
#include <common.h>


struct AST* parse_expression(struct Translation_Data *translation_data,struct Scope *scope);
struct AST_Expression* parse_const_expression(struct Translation_Data *translation_data,struct Scope *scope);
struct AST_Expression* parse_primary_expression(struct Translation_Data *translation_data,struct Scope *scope);

struct AST_Function_Expression* parse_arglist(struct Translation_Data *translation_data,struct Scope *scope,struct AST_Expression* id);

struct AST_Expression* parse_postfix_expression(struct Translation_Data *translation_data,struct Scope *scope);
struct AST_Expression* parse_cast_expression(struct Translation_Data *translation_data,struct Scope *scope);
struct AST_Expression* parse_unary_expression(struct Translation_Data *translation_data,struct Scope *scope);
struct AST_Expression* parse_multiplicative_expression(struct Translation_Data *translation_data,struct Scope *scope);
struct AST_Expression* parse_additive_expression(struct Translation_Data *translation_data,struct Scope *scope);
struct AST_Expression* parse_shift_expression(struct Translation_Data *translation_data,struct Scope *scope);
struct AST_Expression* parse_relational_expression(struct Translation_Data *translation_data,struct Scope *scope);
struct AST_Expression* parse_equality_expression(struct Translation_Data *translation_data,struct Scope *scope);
struct AST_Expression* parse_and_expression(struct Translation_Data *translation_data,struct Scope *scope);
struct AST_Expression* parse_exclusive_or_expression(struct Translation_Data *translation_data,struct Scope *scope);
struct AST_Expression* parse_inclusive_or_expression(struct Translation_Data *translation_data,struct Scope *scope);
struct AST_Expression* parse_logical_and_expression(struct Translation_Data *translation_data,struct Scope *scope);
struct AST_Expression* parse_logical_or_expression(struct Translation_Data *translation_data,struct Scope *scope);
struct AST_Expression* parse_conditional_expression(struct Translation_Data *translation_data,struct Scope *scope);
struct AST_Expression* parse_assignment_expression(struct Translation_Data *translation_data,struct Scope *scope);
struct AST_Expression* parse_comma_expression(struct Translation_Data *translation_data,struct Scope *scope);





/*

expression:
	e15
comma-expression:
	assignment-expression(,assignment-expression)*

assignment-expression:
	unary-expression ( ( = | += | -= | %= | /= | *= | >>= | <<= | &= | |= | ^= ) assignment-expression

conditional-expression:
	logical-or-expression
	logical-or-expression?expression:conditional-expression
logical-or-expression:
	logical-and-expression ( || logical-and-expression )*
logical-and-expression:
	inclusive-or-expression(&&inclusive-or-expression)*
inclusive-or-expression:
	exclusive-or-expression (|exclusive-or-expression)*
exclusive-or-expression:
	and-expression (^ and-expression)*
and-expression:
	equality-expression ( & equality-expression ) *
equality-expression:
	realtional-expression ( ( == | != ) relational-expression )*
relational-expression:
	shift-expression ( ( < | > | <= | >= ) shift-expression )*

shift-expression:
	additive-expression ( ( << | >> ) additive-expression)*

additive-expression:
	multiplicative-expression ( ( + | - ) multiplicative-expression )*

multiplicative-expression:
	cast-expression ( ( * | / | % ) cast-expression )*
	
unary-expression:
	++unary-expression
	--unary-expression
	+unary-expression
	-unary-expression
	!cast-expression
	~cast-expression
	*cast-expression
	&cast-expression
	sizeof ( typename )
	sizeof unary-expression
	postfix-expression

	cast-expression:
		unary-expression
		(type)cast-expression


arglist:
	epsilon
	assignment-expression-list(,assignment-expression-list)*
postfix_expression:
	postfix_expression ++
	postfix_expression --
	postfix_expression [ expression ]
	postfix_expression.id
	postfix_expression->id
	postfix_expression ( arglist )


	primary_expression

primary-expression:
	number
	string
	id
	(e)

*/


#endif