Fixed silly not bug - in one location ! was written \!, which made practically no difference to the regex, but made it so that the parser wouldn't match it to !. Also added else to grammer, but this needs work in the ASTTransformation and CGenerator.
This commit is contained in:
@@ -36,7 +36,7 @@ triple_quoted_string = "\"\"\"((\"\"(`|1|2|3|4|5|6|7|8|9|0|-|=| |q|w|e|r|t|y|u|i
|
|||||||
|
|
||||||
identifier = alpha | alpha alphanumeric ;
|
identifier = alpha | alpha alphanumeric ;
|
||||||
|
|
||||||
overloadable_operator = "\+" | "-" | "\*" | "/" | "%" | "^" | "&" | "\|" | "~" | "\!" | "," | "=" | "\+\+" | "--" | "<<" | ">>" | "==" | "!=" | "&&" | "\|\|" | "\+=" | "-=" | "/=" | "%=" | "^=" | "&=" | "\|=" | "\*=" | "<<=" | ">>=" | "->" ;
|
overloadable_operator = "\+" | "-" | "\*" | "/" | "%" | "^" | "&" | "\|" | "~" | "!" | "," | "=" | "\+\+" | "--" | "<<" | ">>" | "==" | "!=" | "&&" | "\|\|" | "\+=" | "-=" | "/=" | "%=" | "^=" | "&=" | "\|=" | "\*=" | "<<=" | ">>=" | "->" ;
|
||||||
func_identifier = identifier | identifier overloadable_operator ;
|
func_identifier = identifier | identifier overloadable_operator ;
|
||||||
function = template_dec WS type WS func_identifier WS "\(" WS opt_typed_parameter_list WS "\)" WS code_block | type WS func_identifier WS "\(" WS opt_typed_parameter_list WS "\)" WS code_block ;
|
function = template_dec WS type WS func_identifier WS "\(" WS opt_typed_parameter_list WS "\)" WS code_block | type WS func_identifier WS "\(" WS opt_typed_parameter_list WS "\)" WS code_block ;
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ class_innerds = visibility_block WS class_innerds | visibility_block ;
|
|||||||
visibility_block = "public:" WS declaration_block | "protected:" WS declaration_block | "private:" WS declaration_block ;
|
visibility_block = "public:" WS declaration_block | "protected:" WS declaration_block | "private:" WS declaration_block ;
|
||||||
declaration_block = declaration_statement WS ";" WS declaration_block | function WS declaration_block | declaration_statement WS ";" | function ;
|
declaration_block = declaration_statement WS ";" WS declaration_block | function WS declaration_block | declaration_statement WS ";" | function ;
|
||||||
|
|
||||||
if_statement = "if" WS "\(" WS boolean_expression WS "\)" WS statement ;
|
if_statement = "if" WS "\(" WS boolean_expression WS "\)" WS statement | "if" WS "\(" WS boolean_expression WS "\)" WS statement WS "else" WS statement ;
|
||||||
|
|
||||||
while_loop = "while" WS boolean_expression WS statement ;
|
while_loop = "while" WS boolean_expression WS statement ;
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ function_call = unarad "\(" WS opt_parameter_list WS "\)" ;
|
|||||||
|
|
||||||
boolean_expression = boolean_expression WS "\|\|" WS and_boolean_expression | and_boolean_expression ;
|
boolean_expression = boolean_expression WS "\|\|" WS and_boolean_expression | and_boolean_expression ;
|
||||||
and_boolean_expression = and_boolean_expression "&&" bool_exp | bool_exp ;
|
and_boolean_expression = and_boolean_expression "&&" bool_exp | bool_exp ;
|
||||||
bool_exp = "!" WS bool_exp | expression WS comparator WS expression | bool | expression ;
|
bool_exp = expression WS comparator WS expression | bool | expression ;
|
||||||
comparator = "==" | "<=" | ">=" | "!=" | "<" | ">" ;
|
comparator = "==" | "<=" | ">=" | "!=" | "<" | ">" ;
|
||||||
|
|
||||||
expression = expression WS "<<" WS term | expression WS ">>" WS shiftand | shiftand ;
|
expression = expression WS "<<" WS term | expression WS ">>" WS shiftand | shiftand ;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ typedef template<T> vector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void set(int index, T dataIn) {
|
void set(int index, T dataIn) {
|
||||||
if (index < 0 || index => size)
|
if (index < 0 || index >= size)
|
||||||
return;
|
return;
|
||||||
data[index] = dataIn;
|
data[index] = dataIn;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user