Expert Overview: Al Qadisiya vs Al Kholood
This match between Al Qadisiya and Al Kholood is anticipated to be a highly competitive encounter. With an average total of 2.29 goals expected, the game promises to be an exciting spectacle for fans and bettors alike. Both teams have shown strong offensive capabilities, with an average of 2.71 goals scored and 2.18 goals conceded per match. The betting predictions suggest various outcomes, reflecting the dynamic nature of this fixture.
Al Qadisiya
Al Kholood
Predictions:
| Market | Prediction | Odd | Result |
|---|---|---|---|
| Under 5.5 Cards | 98.10% | Make Bet | |
| Both Teams Not To Score In 1st Half | 88.20% | 1.18 Make Bet | |
| Over 1.5 Goals | 76.80% | 1.20 Make Bet | |
| Away Team Not To Score In 1st Half | 73.20% | Make Bet | |
| Away Team Not To Score In 2nd Half | 74.30% | Make Bet | |
| Home Team To Win | 68.60% | 1.48 Make Bet | |
| Under 4.5 Cards | 70.20% | Make Bet | |
| Home Team To Score In 2nd Half | 68.60% | Make Bet | |
| Home Team To Score In 1st Half | 65.70% | Make Bet | |
| Both Teams To Score | 62.90% | 3.40 Make Bet | |
| Over 2.5 BTTS | 61.90% | 2.15 Make Bet | |
| Over 2.5 Goals | 61.30% | 2.15 Make Bet | |
| Goal In Last 15 Minutes | 57.20% | Make Bet | |
| Goal In Last 10 Minutes | 55.70% | Make Bet | |
| First Goal Between Minute 0-29 | 60.50% | Make Bet | |
| Last Goal 73+ Minutes | 56.70% | Make Bet | |
| Both Teams Not To Score In 2nd Half | 55.70% | 1.33 Make Bet | |
| Sum of Goals 2 or 3 | 51.10% | 2.05 Make Bet | |
| Avg. Total Goals | 2.29% | Make Bet | |
| Avg. Goals Scored | 2.71% | Make Bet | |
| Avg. Conceded Goals | 2.18% | Make Bet | |
| Yellow Cards | 1.26% | Make Bet |
Betting Predictions
- Under 5.5 Cards: 98.10
- Both Teams Not To Score In 1st Half: 88.20
- Over 1.5 Goals: 76.80
- Away Team Not To Score In 1st Half: 73.20
- Away Team Not To Score In 2nd Half: 74.30
- Home Team To Win: 68.60
- Under 4.5 Cards: 70.20
- Home Team To Score In 2nd Half: 68.60
- Home Team To Score In 1st Half: 65.70
- Both Teams To Score: 62.90
- Over 2.5 BTTS: 61.90
- Over 2.5 Goals: 61.30
- Goal In Last 15 Minutes: 57.20
- Goal In Last 10 Minutes: 55.70
- First Goal Between Minute 0-29: 60.50
- Last Goal After Minute 73+: 56.70
- Both Teams Not To Score In Second Half: 55.70</l#ifndef PARSER_H
#define PARSER_H#include “types.h”
#include “ast.h”struct parser_state {
token_t token;
ast_node_t *node;
};typedef struct parser_state parser_state_t;
parser_state_t *parser_init(token_stream_t *token_stream);
void parser_free(parser_state_t *state);ast_node_t *parse(parser_state_t *state);
#endif // PARSER_H
nathanoschwald/hydractoken.type == type) {
state->token = next_token(state->token.stream);
return TRUE;
} else {
fprintf(stderr, “%s:%d:%d Expected %s but got %sn”,
state->token.stream->filename,
state->token.line,
state->token.column,
token_type_str(type),
token_type_str(state->token.type));
return FALSE;
}
}static ast_node_t *parse_statement(parser_state_t *state) {
if (expect_token(state, TOKEN_IDENTIFIER)) {
ast_node_t *node = malloc(sizeof(ast_node_t));
node->type = AST_ASSIGNMENT_STATEMENT;
node->assignment_statement.identifier = state->token.text;if (!expect_token(state, TOKEN_EQUALS)) return NULL;
node->assignment_statement.expression =
parse_expression(state);if (!node->assignment_statement.expression)
return NULL;return node;
}if (expect_token(state, TOKEN_INT_LITERAL)) {
ast_node_t *node = malloc(sizeof(ast_node_t));
node->type = AST_EXPRESSION_STATEMENT;int value = atoi(state->token.text);
node->expression_statement.expression =
malloc(sizeof(ast_node_value_literal_int));node->expression_statement.expression->
type = AST_VALUE_LITERAL_INT;node->expression_statement.expression->
value_literal_int.value = value;return node;
}if (expect_token(state, TOKEN_STRING_LITERAL)) {
ast_node_t *node = malloc(sizeof(ast_node_t));
node->type = AST_EXPRESSION_STATEMENT;char* text_value = strdup(state->token.text);
text_value[strlen(text_value) – strlen(“””) – strlen(“””)] =
”;node->expression_statement.expression =
malloc(sizeof(ast_node_value_literal_string));node->expression_statement.expression->
type = AST_VALUE_LITERAL_STRING;node->expression_statement.expression->
value_literal_string.value = text_value;return node;
}if (expect_token(state, TOKEN_RETURN)) {
ast_node_t *node = malloc(sizeof(ast_node_t));
node->type = AST_RETURN_STATEMENT;if (!expect_token(state, TOKEN_IDENTIFIER) &&
!expect_token(state, TOKEN_INT_LITERAL) &&
!expect_token(state, TOKEN_STRING_LITERAL))
return NULL;node->return_statement.return_value =
parse_expression(state);if (!node -> return_statement.return_value)
return NULL;return node;
}if (expect_token(state, TOKEN_IF)) {
ast_node_if_else_stmt* if_else_stmt =
malloc(sizeof(ast_node_if_else_stmt));if_else_stmt -> type = AST_IF_ELSE_STATEMENT;
// Parse the expression
if (!expect_token(state, ‘(‘))
return NULL;if_else_stmt -> condition_expr =
parse_expression(state);if (!if_else_stmt -> condition_expr)
return NULL;// Parse the block of code in curly braces
if (!expect_token(state,'{‘))
return NULL;// Create a new parser state for parsing statements inside
// curly braces
parser_state_t* inner_parser_state =
parser_init( state -> token.stream );hashtable_map( state -> token.stream -> symbol_table,
&inner_parser_state -> token );while( inner_parser_state -> token.type != ‘}’) {
ast_node_if_else_stmt* child_if_else_stmt =
parse_if_else(inner_parser_state);add_child_to_parent(if_else_stmt,
child_if_else_stmt);free(child_if_else_stmt);
free(inner_parser_state);
inner_parser_state =
parser_init( state -> token.stream );hashtable_map( state -> token.stream ->
symbol_table,
&inner_parser_state ->
token );free(inner_parser_state);
inner_parser_state ->
token.stream ->
current_line++;inner_parser_state ->
token.line++;inner_parser_state ->
token.column++;inner_parser_state ->
token.token_index++;inner_parser_state ->
token.text[0] =
”;inner_parser_state ->
node =
NULL;free(inner_parser_state);
}
// TODO finish parsing this statement
}
}static ast_node_block* parse_block(parser_state_t* state){
ast_node_block* block=malloc(sizeof(ast_node_block));block -> type=AST_BLOCK;
while((state -> token.type!=’}’ && state->
token.type!=TOKEN_EOF)){block -> children=malloc(
sizeof(struct ast_block_child)*
(block->
num_children+1));block ->
children[block-
num_children].statement=
parse_statement(
state);block ->
num_children++;free(block);
block=malloc(
sizeof(struct ast_block));block->
children=
realloc(
block->
children,
sizeof(struct ast_block_child)*
(block->
num_children+1));block->
children[block-
num_children].statement=
parse_statement(
state);block->
num_children++;}
// TODO finish parsing this statement
}
static void add_child_to_parent(
ast_node_if_else_stmt* parent,
ast_node_if_else_stmt* child){parent ->
children=
realloc(parent->
children,
sizeof(struct ast_ifelse_child)*
(parent-
num_children+1));parent –
children[parent –
num_children]=child;free(parent);
parent=num_children++;
}static void add_child_to_parent(
ast_ast_block_parent* parent,
ast_ast_block_child* child){parent –
children=
realloc(parent-
children,
sizeof(struct ast_block_child)*
(parent-
num_children+1));parent –
children[parent –
num_children]=child;free(parent);
parent=num_children++;
}parser_state_t*
parser_init(token_stream_t*
stream){
parser_statet *
state=
malloc(sizeof(struct parser_statet));state ->
stream=
stream;state ->
symbol_table=
hashtable_new();hashtable_map(stream ->
symbol_table,
&state –
symbol_table);state ->
line=
stream –
current_line;state ->
column=
stream –
current_column;state ->
index=
stream –
current_index;state ->
text[0]=”;state ->
next_text[0]=”;state :=
next_token(stream);free(stream);
return state;
}
void
parser_free(parser_statet*
state){hashtable_free(&state –
symbol_table);
free(&state);
}
ast_ast*
parse(parser_statet*
state){switch(lexeme_type(&state –
next_text)){case LEXEME_IDENTIFIER:
{struct assignment_ast *
assignment_ast=malloc(
sizeof(struct assignment_ast));assignment_ast-
identifier=strdup(&next_text);expect_next_lexeme(Lexeme_Equals,&next_text,&next_line,&next_column);
assignment_ast-
expression=parse_expression(&state);assignment_ast-
type=AST_ASSIGNMENT_AST;free(next_line);
free(next_column);
return assignment_ast;
}
case LEXEME_INTEGER:
{struct expression_ast *
expression_ast=malloc(
sizeof(struct expression_ast));expression_ast-
value=intstrtol(&next_text,NULL,NULL,NULL);expression_ast-
type=AST_EXPRESSION_AST;free(next_line);
free(next_column);
return expression_ast;
}
case LEXEME_STRING:
{struct string_expr *
string_expr=malloc(
sizeof(struct string_expr));string_expr-
value=strdup(&next_text);string_expr-
type=AST_STRING_EXPR_AST;free(next_line);
free(next_column);
return string_expr;
}
case LEXEME_Return:
{struct ret_val *
ret_val=malloc(
sizeof(struct ret_val));expect_next_lexeme(Lexeme_Identifier | Lexeme_Integer |
Lexeme_String | Lexeme_OpenParenthesis |
Lexeme_OpenBracket | Lexeme_OpenCurlyBrace |
Lexeme_SemiColon | Lexeme_Comma |
Lexeme_Equals | Lexeme_MinusMinus |
Lexeme_PlusPlus | Lexeme_Bang | Lexeme_Tilde |
Token_If | Token_Else | Token_For | Token_While |
Token_Do || Token_Break || Token_Continue ||
Token_Newline ,&next_text,&next_line,&next_column );ret_val-expr=parse_expression(&state);
ret_val-type=AST_RET_VAL_AST;
free(next_line);
free(next_column);
return ret_val;
}
case LEXEME_OpenCurlyBrace:
{struct expr_list *
expr_list=malloc(
sizeof(
struct expr_list));
expr_list-expr_list=
malloc(
sizeof(
struct expr_list_item)*
expr_list-
num_items+1);
expr_list-num_items++;
add_item_to_list(expr_list,
parse_expression(&state),expr_list-num_items-1);
expect_next_lexeme(Token_CloseCurlyBrace,
next_text,next_line,next_column);
expr_list-type=
parse_expression(&state)->type;
free(next_line);
free(next_column);
return expr_list;
}
default:
fprintf(stderr,”Error at %d:%dn”,line,column);
fprintf(stderr,”Unexpected lexem ‘%s’n”,lexemestr(lexemetype(&nexttext)));
exit(EXIT_FAILURE);
break;
}
}
void
add_item_to_list(struct exprlist*
list,
struct exprlistitem*
item,
int index){
list-
items[index]=item;
list-
num_items++
}
ast_expresstype
parse_expression(
parser_statet*
state){
switch(lexemetype(
&statenexttext)){
case LEXEME_Identifier:
case LEXEME_Integer:
case LEXEME_String:
case LEXEME_OpenParenthesis:
case LEXEME_OpenBracket:
case LEXEME_OpenCurlyBrace:
case LEXEME_SemiColon:
case LEXEME_Comma:
case LEXEME_Equals:
case LEXEME_MinusMinus:
case LEXEME_PlusPlus:
case LEXEME_Bang:
case LEXEME_Tilde:
struct exprlist*
expressionlist=
malloc(
sizeof (
struct exprlist ));
int i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;
for(i=j=k=l=m=n=o=p=q=r=s=t=u=v=w=x=y=z=i;i<j;++i)
for(j=k=l=m=n=o=p=q=r=s=t=u=v=w=x=y=z=i;j<k;++j)
for(k=l=m=n=o=p=q=r=s=t=u=v=w=x=y=z=i;k<l;++k)
for(l=m=n=o=p=q=r=s=t=u=v=w=x=y=z=i;l<m;++l)
for(m=n=o=p=q=r=s=t=u=v=w=x=y=z=i;m<n;++m)
for(n=o=p=q=r=s=t=u=v=w=x=y=z=i;n<o;++n)
for(o=p=q=r=s=t=u=v=w=x=y=z=i;o<p;++o)
for(p=q=r=s=t=u=v=w=x=y=z=i;p<q;++p)
for(q=r=s=t=u=v=w=x=y=z=i;q<r;++q)
for(r=s=t=u=v=w=x=y=z=i;r<s;++r)
for(s=t=u=v=w=x=y=z=i;s<t;++s)
for(t=u=v=w=x=y=z=i;t<u;++t)
for(u=v=w=x=y=z=i;u<v;++u)
for(v=w=x=y=z=i;v<w;++v)
for(w=x=y=z=i;w<x;++w)
for(x=y=z=i;x<y;++x)
add_item_to_list(expressionlist,
parse_expression(
&statenexttext),expressionlist-
num_items++)
expect_next_lexemelist({
case Lexemelist_OperandorOperator,
case Lexemelist_Operator},
statenexttext,nextline,nextcolumn)
add_item_to_list(expressionlist,
parse_operator(),
expressionlist-
num_items++)
expect_next_lexemelist({
case Lexemelist_OperandorOperator,
case Lexemelist_Operator},
statenexttext,nextline,nextcolumn)
add_item_to_list(expressionlist,
parse_expression(
&statenexttext),
expressionlist-
num_items++)
expect_next_lexemelist({
case Lexemelist_OperandorOperator},
statenexttext,nextline,nextcolumn)
return create_binop(expreassionlist,
expreassionlist-
items[expreassionlist-
num_items-3],expreassionlist-
items[expreassionlist-
num_items-1])
break
default:
fprintf(stderr,"Error at %d:%dn",linel,linecol)
fprintf(stderr,"Unexpected lexem '%s'n",lexemesstr(lexemetype(&statenexttext)))
exit(EXIT_FAILURE)
break
}
struct binop*
create_binop (
struct expreassionl*
expressionList,int operatorindex){
switch(operatorindex){
case OPERATOR_ANDAND:
case OPERATOR_OROR:
case OPERATOR_EQUALTO:
case OPERATOR_NOTEQUALTO:
case OPERATOR_LESSTHAN:
case OPERATOR_LESSTHANEQUALTO:
case OPERATOR_GREATERTHAN:
case OPERATOR_GREATERTHANEQUALTO:
struct binop *
binop =
malloc (
sizeof (
struct binop ));
binop-left =
expressionList-items[operatorindex-3];
binop-right =
expressionList-items[operatorindex-1];
binop-operator =
operatorindex;
return binop;
break;
default:
fprintf(stderr,"Error at %d:%dn",linel,linecol)
fprintf(stderr,"Unexpected operator index '%d'n",operatorindex)
exit(EXIT_FAILURE)
break;
}
}
int
parse_operator(){
switch(lexemetypenexttext)){
case Lexemenew_LessThan :return LESS_THAN_OPERATOR;break ;
caseLexemenew_LessThanEqual :return LESS_THAN_EQUAL_TO_OPERATOR;break ;
caseLexemenew_GreaterThan :return GREATER_THAN_OPERATOR;break ;
caseLexemenew_GreaterThanEqual :return GREATER_THAN_EQUAL_TO_OPERATOR;break ;
caseLexemenew_Equals :return EQUAL_TO_OPERATOR;break ;
caseLexemenew_NotEquals :return NOT_EQUAL_TO_OPERATOR;break ;
default :
fprintf(stderr,"Error at %d:%dn",linel,linecol)
fprintf(stderr,"Unexpected operator '%s'n",
lexemesstr(lexemetype(&statenexttext)))
exit(EXIT_FAILURE)
break ;
}
}
int
add_itemtoexprlst (
struct expreassionl*
expreassionlst,
struct expreassionlitem*
expreassionlstitm,int index){
expresssionlst-items[index]=expresssionlstitm;
expresssionlst-numitems++
}
int
additemtoexprlst (
struct expresstree*
expresstree,int opindex){
switch(opindex){
expresstree-left=
create_binop(expresssstree-expressionitems[opindex-3],
expresssstree-expressionitems[opindex]);
expresssstree-right=
create_binot(expresssstree-expressionitems[opindex-1],
expresssstree-expressionitems[opindex]);
expresssstree-operator=
operatorindex;
break;
default :
fprintf(stderr,"Error at %d:%dn",linel,linecol)
fprintf(stderr,"Unexpected operator index '%d'n",operatorindex)
exit(EXITFAILURE)
break;
}
}
#ifndef SYMTAB_H
#define SYMTAB_H#include “../lib/hashtable/hashtable.h”
typedef hashtable_entry symtab_entry;
symtab_entry symtab_add(symtab_entry **table,
char const *name,
int address);symtab_entry symtab_get(symtab_entry **table,
char const *name);#endif
nathanoschwald/hydrac ./test/tokenize_output.txt
[] hydrac `./src/hydrac` > ./test/hydrac_output.txt
[] gcc -o test/test.o test/test.c
[] ./test/test.o > ./test/test_output.txt
[] diff ./test/tokenize_expected.txt ./test/tokenize_output.txt > /dev/null ; echo $? >> diff_results.txt
[] diff ./test/hydrac_expected.txt ./test/hydrac_output.txt > /dev/null ; echo $? >> diff_results.txt
[] diff ./test/test_expected.txt ./test/test_output.txt > /dev/null ; echo $? >> diff_results.txtrm -f test/*.o test/*.txt diff_results.txt
nathanoschwald/hydrac
|| version ‘HydraC Compiler’ ‘v0’
|| author Nathan OschwaldPROGRAM hydrac {
IMPORT stdio;
IMPORT libhashtable;
IMPORT libscanner;
IMPORT libcompiler;
IMPORT libcompiler::compiler;
IMPORT libcompiler::syntax_tree;
IMPORT libcompiler::code_gen;
IMPORT libcompiler::symbol_table;// Main function.
FUNCTION main() {
SYMBOL_TABLE table <- NEW SYMBOL_TABLE();
SCANNER scanner <- NEW SCANNER("hydrac");
TOKEN_STREAM tokens <- NEW TOKEN_STREAM(scanner);
PARSER p <- NEW PARSER(tokens);
SYNTAX_TREE tree <- NEW SYNTAX_TREE(p);
CODE_GENERATION cg <- NEW CODE_GENERATION(tree);
CODE_GENERATION::GENERATE(cg);
}
}
nathanoschwald/hydrac
version ‘HydraC Compiler’ ‘v0’
author Nathan OschwaldPROGRAM hydrac {
IMPORT stdio;
IMPORT libhashtable;
IMPORT libscanner;
FUNCTION main() {
SYMBOL_TABLE table <- NEW SYMBOL_TABLE();
SCANNER scanner <- NEW SCANNER("hydrac");
TOKEN_STREAM tokens <- NEW TOKEN_STREAM(scanner);
PARSER p <- NEW PARSER(tokens);
SYNTAX_TREE tree <- NEW SYNTAX_TREE(p);
CODE_GENERATION cg <- NEW CODE_GENERATION(tree);
CODE_GENERATION::GENERATE(cg);}
}
# HydraC Compiler Project Plan v0
## Introduction
This document details how I will implement a compiler for the Hydra programming language as part of my university course COMP30021.
## Language Specification
The language will support:
### Data Types
The language will support four data types:
#### Integer
An integer is a signed integer that can hold any number from -(2^31)-1 to +(2^31)-1.
#### String
A string is a sequence of characters delimited by double quotes (`"`). For example `"Hello World"` is a valid string literal.
#### Boolean
A boolean can take on one of two values:
– `TRUE`
– `FALSE`#### Void
Void is used when no data needs to be returned from a function or procedure call.
### Variables and Constants
Variables are declared using the syntax:
hydra_c
TYPE_NAME variable_name [optional initialisation];For example:
hydra_c
INT x;
STRING y="Hello";
BOOL z=True;
VOID foo();Constants are declared using the syntax:
hydra_c
CONSTANT TYPE_NAME constant_name [optional initialisation];For example:
hydra_c
CONSTANT INT MAX_SIZE OF SIZE_OF_ARRAY;
CONSTANT STRING GREETING OF "Hello World!";
CONSTANT BOOL FLAG OF False;### Operators and Expressions
The following operators are supported by the language:
Arithmetic operators:
– `+`
– `-`
– `*`
– `/`Relational operators:
– “
– `=`Equality operators:
– `==`
– `!=`Boolean operators:
– `&&`
– `||`Assignment operator:
– `=`
All arithmetic operators have higher precedence than relational operators which have higher precedence than equality operators which have higher precedence than boolean operators which have higher precedence than assignment operator.
The following expressions are supported by the language:
#### Arithmetic Expressions
Arithmetic expressions can contain variables or constants along with arithmetic operators such as addition or multiplication.
For example:hydra_c
x + y + z + w + u + v;
a*b*c*d*e*f*g*h*i*j*k*l*m*n;
x*y*z*(a+b+c+d)/(e+f)+g-h+i-j+k-l+m-n-o+p-q-r+s-t*u+v*w-x*y/z+a+b-c+d-e-f*g+h-i+j-k+l-m+n-o*p-q+r-s+t-u+v-w+x-y+z;#### Relational Expressions
Relational expressions can contain variables or constants along with relational operators such as less than or greater than.
For example:hydra_c
xw;a=d;xya>=bdfik==l>mp!=q>rtv==w>x!=y;zb>ce?f=gi=j?l>mp?q>r?s>tv?w>x<y;zb>ce?g=h>ikm?o>p?q>r?s?tvx<y;zb>ce?g=h>ikm?o>p?q>r?s?tvx<y;zbd>e?g=hj<km?o?p?qs<t<u<v<w<xya>=bdfik==l>mp!=q>rtv==w>x!=y;zb>ce?f=gi=j?l>mp?q>r?s>tv?w>x<y;zb>ce?g=hj<km?o?p?qs<t<u<v<w<xn&o&p&q&r&s&tv&w|x&z&a&b&c&!d&e!!f!!g!!h!!i!!j!!!k!!!l!!!m???n???o???p???q???r????s????t????u????v&w|x&z&a?!b?!c?!d?!e?!f?!g?!h?!i?!j?!k?!l??m??n??o??p??q??r???s???t????u????v&w|x&z&a=b=c=d=e=f=g=h=!i=!j=!k=!l=!m=!n=!o=!p=!q=!r=!s=!t=!u=!v&w|x&&z||a||b||c||!(!(!(!(!(!(!(!(!(!(!((((((
(((
)))))))))))))))))))!!!!!!!!!))
`### Statements
Statements in HydraC are terminated by semicolons (`;`). The following statements are supported by HydraC:
#### Assignment Statements
An assignment statement assigns an expression to a variable using the syntax:
hydra_c
variable_name := expression;For example:
hydra_c
x := y+z-a*b/c-d*e+f/g-h*i+j/k-l*m+n/o-p*q+r/s*t-u*v+w/x-y*z+a-b*c+d-e*f-g*h+i/j*k-l/m*n+o/p*q-r*s+t/u*v-w*x+y/z-a*b+c/d-e*f+g/h*i-j/k*l+m/n-o*p+q/r*s-t/u*v+w/x-y*z+a/b-c*d/e+f/g*h-i/j*k+l/m-n/o*p+q/r*s-t/u*v+w/x-y*z+a/b-c*d/e-f/g*h+i/j*k-l/m-n/o*p-q/r*s+t/u*v-w/x+y/z-a*b/c+d/e-f/g*h+i/j*k-l/m-n/o*p+q/r*s-t/u*v+w/x-y*z+a/b-c*d/e-f/g*h+i/j*k-l/m-n/o*p-q/r*s+t/u*v-w/x+y/z-a*b/c+d/e-f/g*h+i/j*k-l/m-n/o*p+q/r*s-t/u*v+w/x-y*z+a/b-c*d/e-f/g*h+i/j*k-l/m-n/o*p-q/r*s+t/u*v-w/x+y/z-a*b/c+d/e-f/g*h+i/j*k-l/m-n/o*p+q/r*s-t/u*v+w/x-y*z+a/b-c*d/e+f/g*h-i/j*k+l/m-n/o*p-q/r*s+t/u*v-w/x+y/z-a*b/c+d-e*f-g*h+i/j*k-l/m-n/o*p+q/r*s-t/u*v+w/x-y*z+a/b-c*d/e+f/g*h-i/j*k+l/m-n/o*p-q/r*s+t/u*v-w/x+y/z-a*b/c+d-e*f-g*h+i/j*k-l/m-n/o*p+q/r*s-t/u*v+w/x-y*z+a/b-c*d/e+f/g*h-i/j*k+l/m-n/o*p-q/r*s+t/u/v-w*x+y/z-a*b+c/d-e*f+g/h*i-j/k*l+m/n-o*p/q*r+s/t*u-v/w*x+y-z/a+b*c-d/e/f*g+h/i*j-k/l*m+n-o/p*q+r/s*t-u/v*w+x/y-z/a+b*c-d*e/f*g+h/i*j-k/l*m+n-o/p*q+r/s*t-u/v*w+x/y-z/a+b*c-d*e/f*g+h/i*j-k/l*m+n-o/p*q+r/s*t-u/v*w+x/y-z/a+b*c-d*e/f*g+h/i*j-k/l*m+n-o/p*q+r/s*t-u/v*w+x/y-z/a+b*c-d*e/f*g+h/i*j-k/l*m+n-o/p*q+r/s*t-u/v*w+x/y-z/a+b*c-d*e/f*g+h/i*j-k/l*m+n-o/p*q+r/s*t-u/v*w+x/y-z/a+b*c-d*e/f*g+h/i*j-k/l*m+n-o/p*q+r/s*t-u/v/w*x+y-z/a+b*c-d*e/f*g+h/i*j-k/l*m+n-o/p/q*r+s/t*u-v/w*x+y-z/a+b*c-d*e/f*g+h/i*j-k/l*m+n-o/p/q*r+s/t*u-v/w*x+y-z/a+b*c-d*e/f*g+h/i*j-k/l*m+n-o/p/q*r+s/t*u-v/w*x+y-z/a+b*c-d*e/f*g+h/i*j-k/l*m+n-o/p/q*r+s/t*u-v/w*x+y-z/a+b*c-d*e/f*g+h/i*j-k/l*m+n-o/p/q*r+s/t*u-v/w*x+y-z/a+b*c-d*e/f*g+h/i*j-k/l*m+n-o/p/q*r+s/t*u-v/w*x%y+z*a-b/c/d%e*f%g%h%i%j%k%l%m%n%o%p%q%s%t%u%v&w%x/y+z*a-b%c%d&e%f%g%%h%i%%j%%k%%%%l%%%%m%%%%%%%%%%%n%%%%%%%%%%%o%%%%%%%%%%%%p%%%%%%%%%%%%%%%q%%%%%%%%%%%%%%%%%%%%%%%%%%%r%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%s%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#### Expression Statement
An expression statement evaluates an expression but does not assign it to any variable using the syntax:
hydra_c
expression;For example:
hydra_c
x*y+z*(a-b)/c*(e-f)*(g-h)*(i-j)*(k-l)*(m*n)+(-(-(-(-(-(-(-(-(O)))))))));
((()))();
((()))();
((()))();
((()))();
((()))();
((()))();
((()))();
((()))();
((()))();
(((())))();#### Return Statement
A return statement returns an evaluated expression from within a function using the syntax:
hydra_c
RETURN(expression);For example:
hydra_c
RETURN(x*y+z*(a-b)/c*(e-f)*(g-h)*(i-j)*(k-l)*(m*n)+(-(-(-(-(-(-(-(-(O))))))))));
RETURN((((())))());
RETURN((((())))());
RETURN((((())))());
RETURN((((())))());
RETURN((((())))());
RETURN((((())))());
RETURN((((())))());
RETURN((((())))());
RETURN(((())()));
`#### If Statement
An if statement allows conditional execution of code depending on whether an evaluated boolean condition evaluates to true or false using the syntax:
hydra_c
IF(condition){}ELSEIF(condition){
}ELSE{
}
For example:
hydra_C
IF(a<b){}ELSEIF(a<b){
}ELSEIF(a<b){
}ELSEIF(a<b){
}ELSEIF(a<b){
}ELSE{
}
`
#### While Loop
A while loop allows execution of code repeatedly based on whether an evaluated boolean condition evaluates to true or false using the syntax:
hydra_C
WHILE(condition){}
`
For example:
hydra_C
WHILE(a<b){}
WHILE(a<b){
}
WHILE(a<b){
}
WHILE(a<b){
}
WHILE(a<b){
}
WHILE(a<b){
}
WHILE(a<b){
}
WHILE(a<b){
}
WHILE(a<b){
}
`
### Function Declaration
Functions allow code reuse within programs through their ability to be called multiple times throughout a program's execution.
The declaration of functions in HydraC requires three components that must be specified in order for them to be correctly compiled into machine code later on during compilation.
These components include their name, their parameters and their body.
Function names must start with an uppercase letter followed by zero or more lowercase letters followed by zero or more digits.
Parameters must all be declared before any other statements within a function's body and must all start with lowercase letters followed by zero or more lowercase letters followed by zero or more digits.
The body of functions may contain any number of statements including nested functions declarations that do not need parameters declared prior to their use within their own bodies but still need them declared before they themselves may be called later on in other parts of another function's body where they were first defined originally.
Example usage could look like this below showing off some examples including nested ones too!
FUNCTION foo(){
FUNCTION bar(){
FUNCTION baz(){
FUNCTION quux(){
FUNCTION quuz(){
}
}
}
}
}
FUNCTION foobar(){
FUNCTION barfoo(){
FUNCTION bazbar(){
FUNCTION quuxfoo(){
FUNCTION quuzbar(){
}
}
}
}
}
## Implementation Plan
### Phase One
Phase one consists mostly out compiling tokens into abstract syntax trees consisting solely out strings containing plain old English words instead just regular old boring numbers like we're used seeing every day here at home so let's get started already shall we ?!? We'll begin writing our compiler starting off right away immediately without wasting anymore time because time waits for no man after all !!!! So let us go forth now please !!! Let us make some magic happen here today people !! Thanks everyone !!!!!!!!!! 🙂 🙂 🙂 🙂 🙂 🙂 🙂 🙂 🙂 🙂 🙂 🙂 🙂 😉 😉 😉 😉 😉 😉 😉 😉 😉 😉 😉
### Phase Two
Phase two consists mostly out compiling abstract syntax trees into machine code consisting solely out strings containing plain old English words instead just regular old boring numbers like we're used seeing every day here at home so let's get started already shall we ?!? We'll begin writing our compiler starting off right away immediately without wasting anymore time because time waits for no man after all !!!! So let us go forth now please !!! Let us make some magic happen here today people !! Thanks everyone !!!!!!!!!! 🙂 🙂 🙂 🙂 🙂 🙂 🙂 🙂 🙂 🙂 :] ) ) ) ) ) ) ) ) ) ) )
### Phase Three
Phase three consists mostly out compiling machine code into assembly language consisting solely out strings containing plain old English words instead just regular old boring numbers like we're used seeing every day here at home so let's get started already shall we ?!? We'll begin writing our compiler starting off right away immediately without wasting anymore time because time waits for no man after all !!!! So let us go forth now please !!! Let us make some magic happen here today people !! Thanks everyone !!!!!!!!!!:) (:):(:):(:):(:):(:):(:):(:):(:):(;):(;):(;