Commit 5554bff7 authored by Alexander Dietsch's avatar Alexander Dietsch

Tempfix for not working Editor

parent 3b1d3658
This diff is collapsed.
......@@ -578,7 +578,7 @@ namespace LWSimulatorGUI
{
int totalCount = 0;
int lineNumb = -1;
for (int i = 0; i < fCTBProgram.Lines.Count; i++)
for (int i = 0; i < fCTBProgram.Lines.Length; i++)
{
totalCount += fCTBProgram.Lines[i].Length;
if (p.Position <= totalCount)
......@@ -589,7 +589,7 @@ namespace LWSimulatorGUI
}
}
if (lineNumb == -1)
lineNumb = fCTBProgram.Lines.Count;
lineNumb = fCTBProgram.Lines.Length;
log.addLine_Notify(string.Format("Syntax error in line {0}, position {1}: {2}",lineNumb, p.Position - totalCount, p.Message));
}
......
......@@ -175,24 +175,6 @@
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABDSURBVDhP3cqhEQAwDIDAjJb9l2oNDkR1ucP9fNbZPS/D
XeEa7grXcFe4hrvCNdwVruGucA13hWu4K1zDXeEa/kczF1t2+Tnu6JcqAAAAAElFTkSuQmCC
</value>
</data>
<data name="fCTBProgram.ServiceColors" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdGYXN0Q29sb3JlZFRleHRCb3gsIFZlcnNpb249Mi4xNi4xMS4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWZiOGFhMTJiOTk0ZWY2MWIMAwAAAFFTeXN0
ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu
PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACJGYXN0Q29sb3JlZFRleHRCb3hOUy5TZXJ2aWNlQ29sb3JzBgAA
ACg8Q29sbGFwc2VNYXJrZXJGb3JlQ29sb3I+a19fQmFja2luZ0ZpZWxkKDxDb2xsYXBzZU1hcmtlckJh
Y2tDb2xvcj5rX19CYWNraW5nRmllbGQqPENvbGxhcHNlTWFya2VyQm9yZGVyQ29sb3I+a19fQmFja2lu
Z0ZpZWxkJjxFeHBhbmRNYXJrZXJGb3JlQ29sb3I+a19fQmFja2luZ0ZpZWxkJjxFeHBhbmRNYXJrZXJC
YWNrQ29sb3I+a19fQmFja2luZ0ZpZWxkKDxFeHBhbmRNYXJrZXJCb3JkZXJDb2xvcj5rX19CYWNraW5n
RmllbGQEBAQEBAQUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAA
ABRTeXN0ZW0uRHJhd2luZy5Db2xvcgMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAFFN5c3RlbS5E
cmF3aW5nLkNvbG9yAwAAABRTeXN0ZW0uRHJhd2luZy5Db2xvcgMAAAACAAAABfz///8UU3lzdGVtLkRy
YXdpbmcuQ29sb3IEAAAABG5hbWUFdmFsdWUKa25vd25Db2xvcgVzdGF0ZQEAAAAJBwcDAAAACgAAAAAA
AAAAlgABAAH7/////P///woAAAAAAAAAAKQAAQAB+v////z///8KAAAAAAAAAACWAAEAAfn////8////
CgAAAAAAAAAAjQABAAH4/////P///woAAAAAAAAAAKQAAQAB9/////z///8KAAAAAAAAAACWAAEACw==
</value>
</data>
<metadata name="cRegisters.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
......
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
\ No newline at end of file
......@@ -102,15 +102,25 @@ namespace TinyPG
}
ParseInputDef(node);
ParseOutputDef(node);
ParseOutputDef(node);
ParseInputDef(node);
ParseAuxDef(node);
tok = scanner.Scan(TokenType.DO);
n = node.CreateNode(tok, tok.ToString() );
node.Token.UpdateRange(tok);
node.Nodes.Add(n);
if (tok.Type != TokenType.DO) {
tree.Errors.Add(new ParseError("Unexpected token '" + tok.Text.Replace("\n", "") + "' found. Expected " + TokenType.DO.ToString(), 0x1001, 0, tok.StartPos, tok.StartPos, tok.Length));
return;
}
ParseProgramM(node);
......@@ -177,16 +187,6 @@ namespace TinyPG
tok = scanner.LookAhead(TokenType.COMMA);
}
tok = scanner.Scan(TokenType.SEMICOLON);
n = node.CreateNode(tok, tok.ToString() );
node.Token.UpdateRange(tok);
node.Nodes.Add(n);
if (tok.Type != TokenType.SEMICOLON) {
tree.Errors.Add(new ParseError("Unexpected token '" + tok.Text.Replace("\n", "") + "' found. Expected " + TokenType.SEMICOLON.ToString(), 0x1001, 0, tok.StartPos, tok.StartPos, tok.Length));
return;
}
parent.Token.UpdateRange(node.Token);
}
......@@ -250,36 +250,32 @@ namespace TinyPG
}
ParseInputRegister(node);
tok = scanner.LookAhead(TokenType.COMMA);
while (tok.Type == TokenType.COMMA)
tok = scanner.LookAhead(TokenType.INPUTCALL);
if (tok.Type == TokenType.INPUTCALL)
{
tok = scanner.Scan(TokenType.COMMA);
n = node.CreateNode(tok, tok.ToString() );
node.Token.UpdateRange(tok);
node.Nodes.Add(n);
if (tok.Type != TokenType.COMMA) {
tree.Errors.Add(new ParseError("Unexpected token '" + tok.Text.Replace("\n", "") + "' found. Expected " + TokenType.COMMA.ToString(), 0x1001, 0, tok.StartPos, tok.StartPos, tok.Length));
return;
}
ParseInputRegister(node);
ParseInputRegister(node);
tok = scanner.LookAhead(TokenType.COMMA);
}
tok = scanner.LookAhead(TokenType.COMMA);
while (tok.Type == TokenType.COMMA)
{
tok = scanner.Scan(TokenType.SEMICOLON);
n = node.CreateNode(tok, tok.ToString() );
node.Token.UpdateRange(tok);
node.Nodes.Add(n);
if (tok.Type != TokenType.SEMICOLON) {
tree.Errors.Add(new ParseError("Unexpected token '" + tok.Text.Replace("\n", "") + "' found. Expected " + TokenType.SEMICOLON.ToString(), 0x1001, 0, tok.StartPos, tok.StartPos, tok.Length));
return;
tok = scanner.Scan(TokenType.COMMA);
n = node.CreateNode(tok, tok.ToString() );
node.Token.UpdateRange(tok);
node.Nodes.Add(n);
if (tok.Type != TokenType.COMMA) {
tree.Errors.Add(new ParseError("Unexpected token '" + tok.Text.Replace("\n", "") + "' found. Expected " + TokenType.COMMA.ToString(), 0x1001, 0, tok.StartPos, tok.StartPos, tok.Length));
return;
}
ParseInputRegister(node);
tok = scanner.LookAhead(TokenType.COMMA);
}
}
parent.Token.UpdateRange(node.Token);
......@@ -373,16 +369,6 @@ namespace TinyPG
}
}
tok = scanner.Scan(TokenType.SEMICOLON);
n = node.CreateNode(tok, tok.ToString() );
node.Token.UpdateRange(tok);
node.Nodes.Add(n);
if (tok.Type != TokenType.SEMICOLON) {
tree.Errors.Add(new ParseError("Unexpected token '" + tok.Text.Replace("\n", "") + "' found. Expected " + TokenType.SEMICOLON.ToString(), 0x1001, 0, tok.StartPos, tok.StartPos, tok.Length));
return;
}
parent.Token.UpdateRange(node.Token);
}
......
......@@ -46,12 +46,12 @@ COMMENTBLOCK -> @"/\*[^*]*\*+(?:[^/*][^*]*\*+)*/";
// Production lines LL(1):
Start -> (MakroDef)* (Program)? EOF;
MakroDef -> DEFINE NAME InputDef OutputDef AuxDef ProgramM ENDDEFINE;
OutputDef -> OUTPUT COLON OutputRegister (COMMA OutputRegister)* SEMICOLON;
MakroDef -> DEFINE NAME OutputDef InputDef AuxDef DO ProgramM ENDDEFINE;
OutputDef -> OUTPUT COLON OutputRegister (COMMA OutputRegister)*;
OutputRegister -> OUTPUTCALL INTEGER;
InputDef -> INPUT COLON InputRegister (COMMA InputRegister)* SEMICOLON;
InputDef -> INPUT COLON ( InputRegister (COMMA InputRegister)* )?;
InputRegister -> INPUTCALL INTEGER;
AuxDef -> AUX COLON (AuxRegister (COMMA AuxRegister)* )? SEMICOLON;
AuxDef -> AUX COLON (AuxRegister (COMMA AuxRegister)* )?;
AuxRegister -> AUXCALL INTEGER;
AnyRegisterM -> (INPUTCALL | (OUTPUTCALL | AUXCALL)) INTEGER;
ProgramM -> (AssignmentM | LoopBodyM | WhileBodyM) (SEMICOLON ProgramM)? ;
......
......@@ -3,14 +3,26 @@
*/
def Plus_One
in: i0;
out: o0;
aux: ;
out: o0
in: i0
aux:
do
o0 := succ(i0)
enddef
x2 := 0;
def Needlessly_Complex_Two
out: o0
in:
aux: a0
do
a0 := succ(succ(succ(0)));
o0 := pred(a0)
enddef
x2 := Needlessly_Complex_Two()(x3);
loop x1 do
x2:= Plus_One(x2)() //Also allows empty Input
end;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment