-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- Code Elements --- | ||
[[SubtractStatement]] [1,8:SUBTRACT]<SUBTRACT> --> [17,17:x]<UserDefinedWord> | ||
|
||
[[SentenceEnd]] [18,18+:.]<PeriodSeparator> --> [18,18+:.]<PeriodSeparator> | ||
|
||
[[SubtractStatement]] [1,8:SUBTRACT]<SUBTRACT> --> [25,28:toto]<UserDefinedWord> | ||
|
||
[[SentenceEnd]] [29,29+:.]<PeriodSeparator> --> [29,29+:.]<PeriodSeparator> | ||
|
||
[[SubtractStatement]] [1,8:SUBTRACT]<SUBTRACT> --> [24,27:toto]<UserDefinedWord> | ||
|
||
[[SentenceEnd]] [28,28+:.]<PeriodSeparator> --> [28,28+:.]<PeriodSeparator> | ||
|
||
[[SubtractStatement]] [1,8:SUBTRACT]<SUBTRACT> --> [28,28:x]<UserDefinedWord> | ||
|
||
[[SentenceEnd]] [1,1+:.]<PeriodSeparator> --> [1,1+:.]<PeriodSeparator> | ||
|
||
[[SubtractStatement]] [1,8:SUBTRACT]<SUBTRACT> --> [17,17:x]<UserDefinedWord> | ||
|
||
[[SentenceEnd]] [18,18+:.]<PeriodSeparator> --> [18,18+:.]<PeriodSeparator> | ||
|
||
[[SubtractStatement]] [1,8:SUBTRACT]<SUBTRACT> --> [19,22:toto]<UserDefinedWord> | ||
|
||
[[SentenceEnd]] [23,23+:.]<PeriodSeparator> --> [23,23+:.]<PeriodSeparator> | ||
|
||
[[SubtractStatement]] [1,8:SUBTRACT]<SUBTRACT> --> [23,26:toto]<UserDefinedWord> | ||
|
||
[[SentenceEnd]] [27,27+:.]<PeriodSeparator> --> [27,27+:.]<PeriodSeparator> | ||
|
||
This comment has been minimized.
Sorry, something went wrong. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
x = a x - | ||
toto = titi tata + toto - | ||
x = a b + ab + x -, toto = a b + ab + toto - | ||
x = a x - | ||
x = 1 x - | ||
toto = 1 2 + toto - | ||
x = 1 2 + 3 + x -, toto = 1 2 + 3 + toto - | ||
This comment has been minimized.
Sorry, something went wrong.
wiztigers
Contributor
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
* ////////////// | ||
* // SUBTRACT // | ||
* ////////////// | ||
|
||
* FORMAT 1 | ||
* IDENTIFIERS | ||
SUBTRACT a FROM x. | ||
SUBTRACT titi tata FROM toto. | ||
SUBTRACT a b ab FROM x toto. | ||
SUBTRACT | ||
a | ||
FROM x | ||
. | ||
* LITERALS | ||
SUBTRACT 1 FROM x. | ||
SUBTRACT 1 2 FROM toto. | ||
SUBTRACT 1 2 3 FROM x toto. | ||
This comment has been minimized.
Sorry, something went wrong.
wiztigers
Contributor
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -231,7 +231,8 @@ public static void Check_EntryCodeElements() | |
|
||
public static void Check_StatementCodeElements() | ||
{ | ||
Check_ADDCodeElements(); | ||
Check_ADDCodeElements(); | ||
Check_SUBTRACTCodeElements(); | ||
} | ||
|
||
public static void Check_ADDCodeElements() | ||
|
@@ -246,5 +247,18 @@ public static void Check_ADDCodeElements() | |
string result = ParserUtils.DumpCodeElements(unit); | ||
ParserUtils.CheckWithResultFile(result, "Statements" + Path.DirectorySeparatorChar + "ADDCodeElements"); | ||
} | ||
|
||
public static void Check_SUBTRACTCodeElements() | ||
{ | ||
DocumentFormat format = new DocumentFormat(Encoding.UTF8, EndOfLineDelimiter.CrLfCharacters, 0, ColumnsLayout.FreeTextFormat); | ||
CompilationUnit unit = ParserUtils.ParseCobolFile("Statements" + Path.DirectorySeparatorChar + "SUBTRACTCodeElements", format); | ||
|
||
string path = "Compiler" + Path.DirectorySeparatorChar + "Parser" + Path.DirectorySeparatorChar + "ResultFiles" + Path.DirectorySeparatorChar + "Statements"; | ||
ArithmeticStatementTester tester = new ArithmeticStatementTester(); | ||
tester.CompareWithRPNFile(unit.SyntaxDocument, path + Path.DirectorySeparatorChar + "SUBTRACTRPN.txt"); | ||
|
||
string result = ParserUtils.DumpCodeElements(unit); | ||
ParserUtils.CheckWithResultFile(result, "Statements" + Path.DirectorySeparatorChar + "SUBTRACTCodeElements"); | ||
} | ||
} | ||
} | ||
This comment has been minimized.
Sorry, something went wrong.
wiztigers
Contributor
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,6 +111,8 @@ | |
<Content Include="Compiler\Parser\ResultFiles\ONCodeElements.txt" /> | ||
<Content Include="Compiler\Parser\ResultFiles\PERFORMCodeElements.txt" /> | ||
<Content Include="Compiler\Parser\ResultFiles\Statements\ADDRPN.txt" /> | ||
<Content Include="Compiler\Parser\ResultFiles\Statements\SUBTRACTCodeElements.txt" /> | ||
<Content Include="Compiler\Parser\ResultFiles\Statements\SUBTRACTRPN.txt" /> | ||
<Content Include="Compiler\Parser\ResultFiles\WHENCodeElements.txt" /> | ||
<Content Include="Compiler\Parser\ResultFiles\HeaderCodeElements.txt" /> | ||
<Content Include="Compiler\Parser\ResultFiles\XMLCodeElements.txt" /> | ||
|
@@ -191,6 +193,7 @@ | |
<None Include="Compiler\Parser\Samples\HeaderCodeElements.cbl" /> | ||
<None Include="Compiler\Parser\Samples\IDCodeElements.cbl" /> | ||
<None Include="Compiler\Parser\Samples\ONCodeElements.cbl" /> | ||
<None Include="Compiler\Parser\Samples\Statements\SUBTRACTCodeElements.cbl" /> | ||
<None Include="Compiler\Parser\Samples\WHENCodeElements.cbl" /> | ||
<None Include="Compiler\Parser\Samples\XMLCodeElements.cbl" /> | ||
<None Include="Compiler\Parser\Samples\UDWCodeElements.cbl" /> | ||
This comment has been minimized.
Sorry, something went wrong.
wiztigers
Contributor
|
||
|
1 comment
on commit 7d2dfee
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, listen !
Notice that I've referenced the linked issue in my commit comment. That's how you should do it, too. Write info once, get it in multiple supports, and track it forever.
This tests recognized tokens. Each token has a starting character and an ending character.
Here you have an alternance of :
I don't test syntax errors (bad! no twinkie for me!), so there's only a
--- Code Elements ---
section, and no--- Diagnostics ---
section.