Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
szabototo89 committed May 20, 2014
1 parent 01aeac6 commit 3452e3c
Show file tree
Hide file tree
Showing 44 changed files with 6,130 additions and 64 deletions.
5 changes: 5 additions & 0 deletions examples/MetaCode/example3.mc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
attribute @extends(name: string);

// az objektumtípusok közötti öröklődést fogjuk szimulálni a makróval
macro ExtendsMacro(trees: { * > type > attribute[name=extends] }) do
foreach (var tree : any in trees) do
Expand Down Expand Up @@ -44,3 +46,6 @@ end;






20 changes: 5 additions & 15 deletions examples/MetaCode/example5.mc
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,20 @@ macro ObjectType(person: { * > type[name=Person] }) do
foreach (var member : any in members(person)) do
// a name adattag típusát megváltoztatjuk any-ra
// a change függvénnyel
// az equals ebben az esetben egy speciláis függvény,
// ugyanis a name(...) egy listával tér vissza, és abban
// keresi a 'name' sztringliterált
if (equals(name(member), 'name'))
// az első paraméterrel mondjuk meg, hogy mit szeretnénk megváltoztatni
// a másodikkal, hogy mely objektumnak akarjuk megváltoztatni
// a harmadikkal pedig megmondjuk, hogy milyen típusú lesz
change('type', type(member), 'any');
change('type', type(member), 'string');
end;
end;
debug(person);
end;

object Person
name: string;
name: __missing__type__;
age: number;
end;

@extends(Person)
object Employee
company: string;
end;








Binary file added install/setup.exe
Binary file not shown.
9 changes: 2 additions & 7 deletions project/MetaCode/MetaCode.CodeVisualizer/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,20 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:avalon="http://icsharpcode.net/sharpdevelop/avalonedit"
xmlns:views="clr-namespace:MetaCode.CodeVisualizer.Views"
Title="MetaCode"
Title="MetaCode IDE"
Height="350"
Width="525">

<DockPanel>
<Menu DockPanel.Dock="Top">
<MenuItem Header="File">
<MenuItem Header="New"
InputGestureText="Ctrl+N"
Click="NewFileCommand">
</MenuItem>
Click="NewFileCommand" />
<MenuItem Header="Open"
InputGestureText="Ctrl+O"
Click="OpenFileCommand" />
<MenuItem Header="Save"
InputGestureText="Ctrl+S"
Click="SaveFileCommand" />
<MenuItem Header="Save generated code"
InputGestureText="Ctrl+Shift+S"
Click="SaveGeneratedFileCommand" />
<Separator />
<MenuItem Header="Close" Click="CloseWindowCommand" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ private void OpenFileCommand(object sender, RoutedEventArgs e)

if (dialog.ShowDialog(this) == true) {
var file = dialog.FileName;
this.Title = "MetaCode IDE - " + file;
using (var text = File.OpenText(file)) {
ViewModel.OriginalSourceCode = text.ReadToEnd();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class MainViewModel : ViewModelBase
private string _output;
private ActionCommand _clearOutputCommand;
private ObservableCollection<string> _messages;
private string _windowTitle;

private Node ParseWithAbstractTreeVisitor(MetaCodeCompiler compiler, string source)
{
Expand Down Expand Up @@ -71,6 +72,7 @@ private void InitializeCompiler()
SemanticParser = new SemanticParser(CompilerService);

InitializeFunctions();
WindowTitle = "MetaCode IDE";
}

private void InitializeFunctions()
Expand Down Expand Up @@ -135,6 +137,16 @@ public ActionCommand ClearOutputCommand
}
}

public string WindowTitle
{
get { return _windowTitle; }
set
{
_windowTitle = value;
OnPropertyChanged(() => WindowTitle);
}
}

public ObservableCollection<string> Messages
{
get { return _messages; }
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified project/MetaCode/MetaCode.CodeVisualizer/obj/Debug/MainWindow.baml
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma checksum "..\..\MainWindow.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "05E6509B5E4D08265A477607D9676ECB"
#pragma checksum "..\..\MainWindow.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "2990525AA4D8B30FFCEA9B52F3E9C161"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
Expand Down Expand Up @@ -84,39 +84,39 @@ void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object
{
case 1:

#line 15 "..\..\MainWindow.xaml"
#line 14 "..\..\MainWindow.xaml"
((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.NewFileCommand);

#line default
#line hidden
return;
case 2:

#line 19 "..\..\MainWindow.xaml"
#line 16 "..\..\MainWindow.xaml"
((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.OpenFileCommand);

#line default
#line hidden
return;
case 3:

#line 22 "..\..\MainWindow.xaml"
#line 18 "..\..\MainWindow.xaml"
((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.SaveFileCommand);

#line default
#line hidden
return;
case 4:

#line 25 "..\..\MainWindow.xaml"
#line 20 "..\..\MainWindow.xaml"
((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.SaveGeneratedFileCommand);

#line default
#line hidden
return;
case 5:

#line 27 "..\..\MainWindow.xaml"
#line 22 "..\..\MainWindow.xaml"
((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.CloseWindowCommand);

#line default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma checksum "..\..\MainWindow.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "05E6509B5E4D08265A477607D9676ECB"
#pragma checksum "..\..\MainWindow.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "2990525AA4D8B30FFCEA9B52F3E9C161"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
Expand Down Expand Up @@ -84,39 +84,39 @@ void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object
{
case 1:

#line 15 "..\..\MainWindow.xaml"
#line 14 "..\..\MainWindow.xaml"
((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.NewFileCommand);

#line default
#line hidden
return;
case 2:

#line 19 "..\..\MainWindow.xaml"
#line 16 "..\..\MainWindow.xaml"
((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.OpenFileCommand);

#line default
#line hidden
return;
case 3:

#line 22 "..\..\MainWindow.xaml"
#line 18 "..\..\MainWindow.xaml"
((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.SaveFileCommand);

#line default
#line hidden
return;
case 4:

#line 25 "..\..\MainWindow.xaml"
#line 20 "..\..\MainWindow.xaml"
((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.SaveGeneratedFileCommand);

#line default
#line hidden
return;
case 5:

#line 27 "..\..\MainWindow.xaml"
#line 22 "..\..\MainWindow.xaml"
((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.CloseWindowCommand);

#line default
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 3452e3c

Please sign in to comment.