Skip to content

Commit

Permalink
Switched to .net-4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vchekan committed Feb 25, 2010
1 parent fba4270 commit 3a20b85
Show file tree
Hide file tree
Showing 28 changed files with 367 additions and 58 deletions.
14 changes: 7 additions & 7 deletions CodeQL.Console/CodeQL.Console.mdp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project name="CodeQL.Console" fileversion="2.0" DefaultNamespace="CodeQL.Console" language="C#" targetFramework="3.5" ctype="DotNetProject">
<Project name="CodeQL.Console" fileversion="2.0" DefaultNamespace="CodeQL.Console" language="C#" targetFramework="4.0" ctype="DotNetProject">
<Configurations active="Debug">
<Configuration name="Debug" ctype="DotNetProjectConfiguration">
<Output directory="bin/Debug" assembly="CodeQL.Console" />
Expand All @@ -19,12 +19,12 @@
<File subtype="Code" buildaction="Compile" name="CodeConsole.cs" />
</Contents>
<References>
<ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Project" localcopy="True" refto="CodeQL" />
<ProjectReference type="Assembly" localcopy="True" specificVersion="False" refto="../lib/Mono.Cecil.dll" />
<ProjectReference type="Assembly" localcopy="True" specificVersion="False" refto="../lib/NDesk.Options.dll" />
<ProjectReference type="Gac" localcopy="True" refto="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Gac" localcopy="True" refto="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Gac" localcopy="True" refto="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=a5715cc6d5c3540b" />
<ProjectReference specificVersion="False" type="Assembly" localcopy="True" refto="../lib/Mono.Cecil.dll" />
<ProjectReference specificVersion="False" type="Assembly" localcopy="True" refto="../lib/NDesk.Options.dll" />
<ProjectReference type="Gac" localcopy="True" refto="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Gac" localcopy="True" refto="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Gac" localcopy="True" refto="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference specificVersion="False" type="Assembly" localcopy="True" refto="../lib/log4net.dll" />
</References>
</Project>
6 changes: 2 additions & 4 deletions CodeQL.Console/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ public static int Main(string[] args)
Add("file=", o => _files.Add(o) ).
Add("print", o => _action = Print ).
Add("console", o => { _action = new CodeConsole().Run; }).
Add("scan", o => { _action =
() => {new BinScanner().AddFiles(_files).Scan(); };
}).
Add("translate", o => {_action = () => new CodeQLQuery().Select(_unparsed);}).
Add("scan", o => _action = () => {new BinScanner().AddFiles(_files).Scan(); }).
Add("translate", o => _action = () => new CodeQLQuery().Select(_unparsed)).
Add("help|h|?", o => _action = () => { _options.WriteOptionDescriptions(SysConsole.Error); });

var remains = _options.Parse(args);
Expand Down
8 changes: 4 additions & 4 deletions CodeQL.Testing/CodeQL.Testing.mdp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project name="CodeQL.Testing" fileversion="2.0" DefaultNamespace="CodeQL.Testing" language="C#" targetFramework="3.5" ctype="DotNetProject">
<Project name="CodeQL.Testing" fileversion="2.0" DefaultNamespace="CodeQL.Testing" language="C#" targetFramework="4.0" ctype="DotNetProject">
<Configurations active="Debug">
<Configuration name="Debug" ctype="DotNetProjectConfiguration">
<Output directory="bin/Debug" assembly="CodeQL.Testing" />
Expand All @@ -23,11 +23,11 @@
<File subtype="Code" buildaction="Compile" name="TestTranslator.cs" />
</Contents>
<References>
<ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Project" localcopy="True" refto="CodeQL" />
<ProjectReference type="Gac" localcopy="True" refto="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Gac" localcopy="True" refto="nunit.core, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" />
<ProjectReference type="Gac" localcopy="True" refto="nunit.framework, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" />
<ProjectReference type="Gac" localcopy="True" refto="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=a5715cc6d5c3540b" />
<ProjectReference type="Gac" localcopy="True" refto="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Gac" localcopy="True" refto="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference specificVersion="False" type="Assembly" localcopy="True" refto="../lib/log4net.dll" />
</References>
</Project>
4 changes: 2 additions & 2 deletions CodeQL.Testing/TestClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void CheckAssemblies() {
Assert.AreEqual(1, asm.Count, "Expect to find just one assembly");
}

//[Test]
[Ignore]
public void AssemblyAttributesShort() {
// AssemblyTitle("CodeQL.Testing")]
var attributes = new RawQuery().
Expand All @@ -45,7 +45,7 @@ public void AssemblyAttributesShort() {
Assert.AreEqual(1, attributes.Count, "Expect just one AssemblyTitle attribute");
}

[Test]
[Ignore]
public void AssemblyAttributesLong() {
// attribute with "Attribute" suffix
}
Expand Down
18 changes: 9 additions & 9 deletions CodeQL.UI/CodeQL.UI.mdp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project name="CodeQL.UI" fileversion="2.0" DefaultNamespace="CodeQL.UI" language="C#" targetFramework="3.5" ctype="DotNetProject">
<Project name="CodeQL.UI" fileversion="2.0" DefaultNamespace="CodeQL.UI" language="C#" targetFramework="4.0" ctype="DotNetProject">
<Configurations active="Debug">
<Configuration name="Debug" ctype="DotNetProjectConfiguration">
<Output directory="bin/Debug" assembly="CodeQL.UI" />
Expand All @@ -24,14 +24,14 @@
<File subtype="Code" buildaction="Compile" name="gtk-gui/CodeQL.UI.ProjectProperties.cs" />
</Contents>
<References>
<ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Gac" localcopy="True" specificVersion="False" refto="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<ProjectReference type="Gac" localcopy="True" specificVersion="False" refto="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<ProjectReference type="Gac" localcopy="True" specificVersion="False" refto="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<ProjectReference type="Gac" localcopy="True" specificVersion="False" refto="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<ProjectReference type="Gac" localcopy="True" specificVersion="False" refto="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
<ProjectReference type="Gac" localcopy="True" refto="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference specificVersion="False" type="Gac" localcopy="True" refto="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<ProjectReference specificVersion="False" type="Gac" localcopy="True" refto="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<ProjectReference specificVersion="False" type="Gac" localcopy="True" refto="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<ProjectReference specificVersion="False" type="Gac" localcopy="True" refto="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<ProjectReference specificVersion="False" type="Gac" localcopy="True" refto="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<ProjectReference type="Project" localcopy="True" refto="CodeQL" />
<ProjectReference type="Gac" localcopy="True" refto="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
<ProjectReference type="Gac" localcopy="True" refto="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</References>
</Project>
1 change: 1 addition & 0 deletions CodeQL.UI/gtk-gui/CodeQL.UI.ProjectProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace CodeQL.UI {


public partial class ProjectProperties {

private Gtk.VBox vbox2;
Expand Down
1 change: 1 addition & 0 deletions CodeQL.UI/gtk-gui/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// ------------------------------------------------------------------------------



public partial class MainWindow {

private Gtk.UIManager UIManager;
Expand Down
1 change: 1 addition & 0 deletions CodeQL.UI/gtk-gui/generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace Stetic {


internal class Gui {

private static bool initialized;
Expand Down
27 changes: 17 additions & 10 deletions CodeQL.mdp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project name="CodeQL" fileversion="2.0" DefaultNamespace="CodeQL" language="C#" clr-version="Net_2_0" targetFramework="3.5" ctype="DotNetProject">
<Project name="CodeQL" fileversion="2.0" DefaultNamespace="CodeQL" language="C#" clr-version="Net_2_0" targetFramework="4.0" ctype="DotNetProject">
<Configurations active="Debug">
<Configuration name="Debug" ctype="DotNetProjectConfiguration">
<Output directory="bin/Debug" assembly="CodeQL" />
Expand Down Expand Up @@ -46,21 +46,28 @@
<File subtype="Code" buildaction="Compile" name="BinScanner.cs" />
<File subtype="Code" buildaction="Compile" name="Translate/ClassHandler.cs" />
<File subtype="Code" buildaction="Compile" name="CqlAst/TableNode.cs" />
<File subtype="Code" buildaction="Compile" name="CqlAst/StatementNode.cs" />
<File subtype="Code" buildaction="Compile" name="Translate/SqlWriter.cs" />
<File subtype="Code" buildaction="Compile" name="CqlAst/SelectExpressionNode.cs" />
<File subtype="Code" buildaction="Compile" name="CqlAst/ColumnExpressionNode.cs" />
<File subtype="Code" buildaction="Compile" name="CqlAst/ConstNode.cs" />
<File subtype="Code" buildaction="Nothing" name="doc/design.txt" />
<File subtype="Code" buildaction="Compile" name="Translate/TranslationContext.cs" />
<File subtype="Directory" buildaction="Compile" name="Graphs" />
<File subtype="Code" buildaction="Compile" name="Graphs/GraphIterator.cs" />
<File subtype="Code" buildaction="Compile" name="CqlAst/INode.cs" />
<File subtype="Code" buildaction="Compile" name="Translate/AstManager.cs" />
<File subtype="Code" buildaction="Compile" name="CqlAst/Node.cs" />
<File subtype="Code" buildaction="Compile" name="CqlAst/StatementNode.cs" />
</Contents>
<References>
<ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Assembly" localcopy="True" specificVersion="False" refto="lib/System.Data.SQLite.dll" />
<ProjectReference type="Assembly" localcopy="True" specificVersion="False" refto="lib/FirebirdSql.Data.FirebirdClient.dll" />
<ProjectReference type="Assembly" localcopy="True" specificVersion="False" refto="lib/Mono.Cecil.dll" />
<ProjectReference type="Gac" localcopy="True" refto="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Gac" localcopy="True" refto="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Gac" localcopy="True" refto="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Gac" localcopy="True" refto="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=a5715cc6d5c3540b" />
<ProjectReference specificVersion="False" type="Assembly" localcopy="True" refto="lib/System.Data.SQLite.dll" />
<ProjectReference specificVersion="False" type="Assembly" localcopy="True" refto="lib/FirebirdSql.Data.FirebirdClient.dll" />
<ProjectReference specificVersion="False" type="Assembly" localcopy="True" refto="lib/Mono.Cecil.dll" />
<ProjectReference specificVersion="False" type="Assembly" localcopy="True" refto="lib/log4net.dll" />
<ProjectReference type="Gac" localcopy="True" refto="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Gac" localcopy="True" refto="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Gac" localcopy="True" refto="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Gac" localcopy="True" refto="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</References>
<MonoDevelop.Autotools.MakefileInfo RelativeMakefileName="Makefile" BuildTargetName="build">
<BuildFilesVar />
Expand Down
4 changes: 3 additions & 1 deletion CodeQL.mds
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<Combine fileversion="2.0" name="CodeQL">
<Policies>
<StandardHeader inheritsSet="GPLv2License" />
<TextStylePolicy inheritsSet="null" scope="text/x-csharp" />
<CSharpFormattingPolicy NamespaceBraceStyle="EndOfLine" ClassBraceStyle="EndOfLine" InterfaceBraceStyle="EndOfLine" StructBraceStyle="EndOfLine" EnumBraceStyle="EndOfLine" MethodBraceStyle="EndOfLine" ConstructorBraceStyle="EndOfLine" DestructorBraceStyle="EndOfLine" PlaceCatchOnNewLine="True" PlaceFinallyOnNewLine="True" BeforeMethodCallParentheses="False" BeforeMethodDeclarationParentheses="False" BeforeConstructorDeclarationParentheses="False" BeforeDelegateDeclarationParentheses="False" NewParentheses="False" IfParentheses="False" WhileParentheses="False" ForParentheses="False" ForeachParentheses="False" CatchParentheses="False" SwitchParentheses="False" LockParentheses="False" UsingParentheses="False" inheritsSet="Mono" inheritsScope="text/x-csharp" scope="text/x-csharp" />
</Policies>
<Configurations active="Debug">
<Configuration name="Debug" ctype="CombineConfiguration">
Expand All @@ -20,7 +22,7 @@
<Entry build="True" name="CodeQL.Testing" configuration="Release" />
</Configuration>
</Configurations>
<StartMode startupentry="CodeQL.Console" single="True">
<StartMode startupentry="CodeQL.Testing" single="True">
<Execute type="None" entry="CodeQL" />
<Execute type="None" entry="SQLDetector" />
<Execute type="None" entry="CodeQL.UI" />
Expand Down
3 changes: 3 additions & 0 deletions CodeQLQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ public string Translate(string cql, params object[] arguments) {
if(!parser.Parse(cql))
throw new ApplicationException("Parsing error");

// run transforms
new ClassHandler().Run();

return new SqlWriter().Write(parser.Batch);
}

Expand Down
8 changes: 6 additions & 2 deletions CqlAst/BatchNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@

using System;
using System.Collections.Generic;
using System.Linq;

namespace CodeQL
{
public class BatchNode
public class BatchNode : Node
{
public List<StatementNode> Statements = new List<StatementNode>();

public override IEnumerable<INode> Children {
get {return Statements.Cast<INode>();}
}

}
}
35 changes: 35 additions & 0 deletions CqlAst/INode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//
// Node.cs
//
// Author:
// Vadim Chekan <[email protected]>
//
// Copyright (c) 2010 Vadim Chekan
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//

using System;
using System.Collections.Generic;

namespace CodeQL {


public interface INode {
IEnumerable<INode> Children {get;}
INode Parent {get;set;}
void Remove(INode child);
}
}
33 changes: 33 additions & 0 deletions CqlAst/Node.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// Node.cs
//
// Author:
// Vadim Chekan <[email protected]>
//
// Copyright (c) 2010 Vadim Chekan
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
using System;
using System.Collections.Generic;
namespace CodeQL {

public abstract class Node : INode {
public INode Parent {get; set;}
public abstract IEnumerable<INode> Children {get;}
public virtual void Remove(INode child) {throw new NotImplementedException();}
}
}

6 changes: 6 additions & 0 deletions CqlAst/SelectNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,18 @@

using System;
using System.Collections.Generic;
using System.Linq;

namespace CodeQL
{

public class SelectNode : StatementNode
{
public List<SelectExpressionNode> SelectExpressions;

public override IEnumerable<INode> Children {
get { return SelectExpressions.Cast<INode>(); }
}

}
}
13 changes: 4 additions & 9 deletions CqlAst/StatementNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Author:
// Vadim Chekan <[email protected]>
//
// Copyright (c) 2009 Vadim Chekan
// Copyright (c) 2010 Vadim Chekan
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand All @@ -20,14 +20,9 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//

using System;

namespace CodeQL
{

public abstract class StatementNode
{

namespace CodeQL {
public abstract class StatementNode : Node {
}
}

8 changes: 7 additions & 1 deletion CqlAst/TableNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@
//

using System;
using System.Collections.Generic;

namespace CodeQL
{

public class TableNode
public class TableNode : Node
{
public string Name;
public string Alias;

public override IEnumerable<INode> Children {
get {yield break;}
}

}
}
Loading

0 comments on commit 3a20b85

Please sign in to comment.