Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
80 changed files
with
19,967 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
type | ||
B = class | ||
x: real; | ||
end; | ||
A = class | ||
b1 := new B; | ||
property X: real read b1.x write begin b1.x := value; Print(value); end; | ||
end; | ||
|
||
var a1 := new A; | ||
|
||
begin | ||
a1.X := 2; | ||
a1.X.Print; | ||
Assert(a1.X = 2); | ||
end. |
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
%Extension "cs" | ||
%CaseSensitive | ||
%Preprocessor Define="define" Undef="undef" IfDef="if" ElIf="elif" Else="else" End="endif" | ||
|
||
Skip Begin "//" | ||
Skip Begin "#" Preprocessor | ||
Skip Begin "/*" End "*/" | ||
Skip BeginEnd "'" EscapeSymbol "'" | ||
Skip BeginEnd '\"' EscapeSymbol '\\' | ||
Skip Begin '@\"' End '\"' | ||
|
||
Token LetterDigits [[:IsLetterOrDigit:]_&]* | ||
Token Sign [[:IsPunctuation:][:IsSymbol:]] | ||
|
||
Rule tkClassNamespace : @"class" | @"namespace" | ||
Rule @Block : "{" [Any | Block]* "}" | ||
Rule Tk : @AnyExcept(tkClassNamespace, "{", "}", ";") | ||
|
||
Rule Program : #ProgramNode* | ||
Rule ProgramNode: #ClassOrNamespace | ||
| #Field | ||
| #Method | ||
| #error | ||
|
||
Rule ClassOrNamespace : @Tk* @tkClassNamespace @Tk* "{" #ProgramNode* "}" | ||
Rule Field : @Tk* ";" | ||
Rule Method : @Tk* Block | ||
|
||
//�� ��� ��� ��� 20 ����� | ||
//������� � �������� ����� ��� �������, ���������� ������� � ���������� �������� |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
%CaseSensitive | ||
%Extension "java" | ||
|
||
Skip Begin "//" | ||
Skip Begin "/*" End "*/" | ||
Skip BeginEnd "'" EscapeSymbol "'" | ||
Skip BeginEnd '\"' EscapeSymbol '\\' | ||
|
||
Token ID [[:IsLetterOrDigit:]_]+ | ||
Token Sign [[:IsPunctuation:][:IsSymbol:]] | ||
|
||
//TODO - field initializer: String [] Names = {"1", "2"}; | ||
|
||
Rule @Code : "{" [Any|Code]* "}" | ||
|
||
Rule TKList : @AnyExcept("class", "{", "}", ";")* | ||
|
||
Rule Program: #Imports* #Class+ | ||
Rule Imports: @TKList ";" | ||
Rule Class : @TKList @"class" @ID "{" #ClassEntity* "}" | ||
Rule ClassEntity : #Field | #Method | ||
Rule Field : @TKList ";" | ||
Rule Method : @TKList #Code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
%Extension "pas" | ||
%CaseInsensitive | ||
|
||
Skip Begin "//" | ||
Skip Begin "#" | ||
Skip Begin "{" End "}" | ||
Skip Begin "/*" End "*/" | ||
Skip BeginEnd "'" EscapeSymbol "'" | ||
|
||
Token LetterDigits [[:IsLetterOrDigit:]_&]* | ||
Token Sign [[:IsPunctuation:][:IsSymbol:]] | ||
|
||
Rule tkCodeOpen : @"begin" | @"case" | @"try" | ||
Rule tkClassOpen : @"class" | @"interface" | @"record" | ||
Rule tkDefs : @"var" | @"const" | @"label" | ||
Rule tkClassVisModifier : @"internal" | @"private" | @"protected" | @"public" | ||
Rule tkMethod : @"procedure" | @"function" | @"constructor" | @"destructor" | ||
Rule tkDirective : @"forward" | @"external" | ||
Rule tkDirectiveHeader : @"virtual" | @"override" | @"reintroduce" | ||
Rule tkInitFinal: @"initialization" | @"finalization" | ||
Rule tkInterf: @"interface" | ||
Rule tkImpl: @"implementation" | ||
|
||
Rule Params : @"(" [@Any|@Params]* @")" | ||
Rule @Block : tkCodeOpen [Any | Block]* "end" | ||
Rule Attribute : @"[" [@Any | @Attribute]* @"]" | ||
|
||
Rule Tk: @LetterDigits | @Sign | @Params | @"." | ||
Rule Tk2: @LetterDigits | @Sign | @Params | @"." | @tkMethod | @"type" | @"[" |@"]" | ||
|
||
Rule Program : List0(ProgramNode) [#Block "." | "end" "."] Any* | ||
|
||
Rule ProgramNode: #Defs | ||
| #Field | ||
| #Method | ||
| #InitFinal | ||
| #InterfacePart | ||
| #Attribute | ||
| #error | ||
|
||
Rule ClassNode : tkClassVisModifier | ||
| "class"? #Field | ||
| #ClassMethod | ||
| #Attribute | ||
| #error | ||
|
||
Rule InterfacePart: tkInterf #InterfNode* tkImpl | ||
|
||
Rule InterfNode: #Defs | ||
| #Field | ||
| #MethodHeader | ||
| #Attribute | ||
| #error | ||
|
||
Rule Field : @Tk @Tk2* ";" | ||
Rule Class : @Tk @Tk2* @tkClassOpen @Params? List0(ClassNode) "end" ";" | ||
|
||
Rule Method: @MethodHeader #MethodBody | ||
Rule MethodHeader: @"class"? @tkMethod @Tk* ";" @DirectiveHeader* | ||
Rule MethodBody: Directive | ||
| List0(MethodLocals) #Block ";" | ||
Rule MethodLocals: #Defs | ||
| #Method | ||
|
||
Rule ClassMethod: @MethodHeader #ClassMethodBody | ||
Rule ClassMethodBody: //empty | ||
| Directive | ||
| List0(Defs) #Block ";" | ||
Rule Defs : [tkDefs|"type"] List1(FieldOrClass) | ||
Rule FieldOrClass: #Field | #Class | ||
|
||
Rule Directive: @tkDirective @Any* ";" | ||
Rule DirectiveHeader: @tkDirectiveHeader ";" | ||
|
||
Rule InitFinal : @tkInitFinal CodeToken* | ||
Rule CodeToken: AnyExcept(tkInitFinal, "end", tkCodeOpen) | Block |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
%CaseSensitive | ||
%Extension "xml" "xaml" | ||
|
||
Skip Begin "<!--" End "-->" | ||
|
||
Token ID [[:IsLetterOrDigit:]_]+ | ||
Token Sign [[:IsPunctuation:][:IsSymbol:]] | ||
|
||
Rule TagStart: "<" | ||
Rule TagEnd: ">" | ||
|
||
Rule Program: [#XMLDecl|#DoctypeDcecl|#Tag]+ | ||
|
||
Rule XMLDecl : TagStart "?" @"xml" #Attribute* "?" TagEnd | ||
Rule DoctypeDcecl: TagStart "!" @"DOCTYPE" #Attribute* TagEnd | ||
|
||
Rule Tag: TagStart @ID #Attribute* TagEnd [#Tag|#Text]* CloseTag | ||
| TagStart @ID #Attribute* "/" TagEnd | ||
Rule CloseTag : TagStart "/" @ID TagEnd | ||
Rule Attribute: @AnyExcept(">")+ "=" #String | ||
Rule Text : @AnyExcept("<",">")+ | ||
Rule String : @'\"' @Any* @'\"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
%CaseSensitive | ||
%Extension "y" | ||
|
||
Skip Begin "//" | ||
Skip Begin "/*" End "*/" | ||
Skip BeginEnd "'" EscapeSymbol "'" | ||
Skip BeginEnd '\"' EscapeSymbol '\\' | ||
|
||
Token LetterDigit [[:IsLetterOrDigit:]_]+ | ||
Token Sign [[:IsPunctuation:][:IsSymbol:]] | ||
|
||
Rule @Action : "{" [Any|Action]* "}" //���� ����, ������������ ��������� �������� | ||
|
||
Rule @Program : #Section1 "%%" #Section2 "%%" #Section3 //��������� ������� | ||
|
||
Rule @Section1 : List0(S1Node) //������ 1 � �� ������� | ||
Rule S1Node : @"%{" @Any* @"%}" | ||
| @"%" @AnyExcept("%%", "%", "{") @AnyExcept("%%", "%")* | ||
| error | ||
|
||
Rule @Section2 : List0(yRule) //������ 2 � �� ������� | ||
Rule yRule : @LetterDigit ":" List1(SubRule, "|") ";" //@LetterDigit ":" List1(SubRule, "|") ";" | ||
| error | ||
Rule SubRule : @List0(subRulePart) | ||
Rule subRulePart : @AnyExcept("{", "|", ";") | ||
| @Action | ||
|
||
Rule @Section3 : Any* |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.