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
0 parents
commit 33fd47f
Showing
9 changed files
with
683 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,5 @@ | ||
bin | ||
obj | ||
*.sln.fire.cache | ||
*.sln.fire.user | ||
|
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,6 @@ | ||
import Sugar | ||
import Sugar.Collections | ||
|
||
public class CGEntity { | ||
} | ||
|
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,53 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="yes"?> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build" ToolsVersion="4.0"> | ||
<PropertyGroup> | ||
<RootNamespace>CodeGen4</RootNamespace> | ||
<ProjectGuid>EA4135EC-C7A2-454F-A53C-A9B6FE92DA94</ProjectGuid> | ||
<OutputType>StaticLibrary</OutputType> | ||
<AssemblyName>CodeGen4</AssemblyName> | ||
<AllowGlobals>False</AllowGlobals> | ||
<AllowLegacyWith>False</AllowLegacyWith> | ||
<AllowLegacyOutParams>False</AllowLegacyOutParams> | ||
<AllowLegacyCreate>False</AllowLegacyCreate> | ||
<AllowUnsafeCode>False</AllowUnsafeCode> | ||
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration> | ||
<SDK>OS X</SDK> | ||
<CreateHeaderFile>True</CreateHeaderFile> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> | ||
<Optimize>false</Optimize> | ||
<OutputPath>.\bin\Debug</OutputPath> | ||
<DefineConstants>DEBUG;TRACE;</DefineConstants> | ||
<GenerateDebugInfo>True</GenerateDebugInfo> | ||
<EnableAsserts>True</EnableAsserts> | ||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors> | ||
<CaptureConsoleOutput>False</CaptureConsoleOutput> | ||
<WarnOnCaseMismatch>True</WarnOnCaseMismatch> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> | ||
<Optimize>true</Optimize> | ||
<OutputPath>.\bin\Release</OutputPath> | ||
<GenerateDebugInfo>False</GenerateDebugInfo> | ||
<EnableAsserts>False</EnableAsserts> | ||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors> | ||
<CaptureConsoleOutput>False</CaptureConsoleOutput> | ||
<WarnOnCaseMismatch>True</WarnOnCaseMismatch> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Foundation.fx"/> | ||
<Reference Include="rtl.fx"/> | ||
<Reference Include="libNougat.fx"/> | ||
<Reference Include="libSugar"> | ||
<HintPath>..\..\Xcode\DerivedData\Fire-gudanmcdbkoejsaanfhrydpjbude\Build\Products\Debug\libSugar.fx</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="TypeDefinitions.swift"/> | ||
<Compile Include="Base.swift"/> | ||
<Compile Include="Statements.swift"/> | ||
<Compile Include="TypeReferences.swift"/> | ||
<Compile Include="Expressions.swift"/> | ||
<None Include="README.md"/> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildExtensionsPath)/RemObjects Software/Oxygene/RemObjects.Oxygene.Nougat.targets"/> | ||
</Project> |
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,20 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# RemObjects Fire | ||
Project("{656346D9-4656-40DA-A068-22D5425D4639}") = "CodeGen4", "CodeGen4.elements", "{EA4135EC-C7A2-454F-A53C-A9B6FE92DA94}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|AnyCPU = Debug|AnyCPU | ||
Release|AnyCPU = Release|AnyCPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{EA4135EC-C7A2-454F-A53C-A9B6FE92DA94}.Debug|AnyCPU.ActiveCfg = Debug|AnyCPU | ||
{EA4135EC-C7A2-454F-A53C-A9B6FE92DA94}.Debug|AnyCPU.Build.0 = Debug|AnyCPU | ||
{EA4135EC-C7A2-454F-A53C-A9B6FE92DA94}.Release|AnyCPU.ActiveCfg = Release|AnyCPU | ||
{EA4135EC-C7A2-454F-A53C-A9B6FE92DA94}.Release|AnyCPU.Build.0 = Release|AnyCPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
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,216 @@ | ||
import Sugar | ||
import Sugar.Collections | ||
|
||
/* Expressions */ | ||
|
||
public class CGExpression: CGStatement { | ||
} | ||
|
||
public class CGAssigedExpression: CGExpression { | ||
var Value: CGExpression | ||
|
||
init(_ value: CGExpression) { | ||
Value = value | ||
} | ||
} | ||
|
||
public class CGSizeOfExpression: CGExpression { | ||
public var Expression: CGExpression | ||
|
||
init(_ expression: CGExpression) { | ||
Expression = expression | ||
} | ||
} | ||
|
||
public class CGTypeOfExpression: CGExpression { | ||
public var Expression: CGExpression | ||
|
||
init(_ expression: CGExpression) { | ||
Expression = expression | ||
} | ||
} | ||
|
||
public class CGDefaultExpression: CGExpression { | ||
public var `Type`: CGTypeReference | ||
|
||
init(_ type: CGTypeReference) { | ||
`Type` = type | ||
} | ||
} | ||
|
||
public class CGSelectorExpression: CGExpression { /* Cocoa only */ | ||
var SelectorName: String | ||
|
||
init(_ selectorNameame: String) { | ||
SelectorName = selectorNameame; | ||
} | ||
} | ||
|
||
public class CGTypeCastExpression: CGExpression { | ||
public var Expression: CGExpression? | ||
public var TargetType: CGTypeReference? | ||
public var ThrowsException = false | ||
public var GuaranteedSafe = false // in Silver, this uses "as" | ||
|
||
init(_ expression: CGExpression, _ targetType: CGTypeReference) { | ||
Expression = expression | ||
TargetType = targetType | ||
} | ||
} | ||
|
||
public class CGAwaitExpression: CGExpression { | ||
//incomplete | ||
} | ||
|
||
public class CGAnonymousMethodExpression: CGExpression { | ||
public var lambda = true | ||
//incomplete | ||
} | ||
|
||
public class CGAnonymousClassOrStructExpression: CGExpression { | ||
public var TypeDefinition: CGClassOrStructTypeDefinition | ||
|
||
init(_ typeDefinition: CGClassOrStructTypeDefinition) { | ||
TypeDefinition = typeDefinition | ||
} | ||
} | ||
|
||
public class CGInheritedxpression: CGExpression { | ||
public var Expression: CGExpression | ||
|
||
init(_ expression: CGExpression) { | ||
Expression = expression | ||
} | ||
} | ||
|
||
/* | ||
public class CGIfThenElseExpression: CGExpression { //* Oxygene only */ | ||
//incomplete | ||
} | ||
public class CGCaseExpression: CGExpression { //* Oxygene only */ | ||
//incomplete | ||
} | ||
public class CGForToLoopExpression: CGExpression { //* Oxygene only */ | ||
//incomplete | ||
} | ||
public class CGForEachLoopExpression: CGExpression { //* Oxygene only */ | ||
//incomplete | ||
} | ||
*/ | ||
|
||
public class CGBinaryOperatorExpression: CGExpression { | ||
var LefthandValue: CGExpression | ||
var RighthandValue: CGExpression | ||
var Operator: CGOperatorKind? // for standard operators | ||
var OperatorString: String? // for custom operators | ||
|
||
init(_ lefthandValue: CGExpression, _ righthandValue: CGExpression, _ `operator`: CGOperatorKind) { | ||
LefthandValue = lefthandValue | ||
RighthandValue = righthandValue | ||
Operator = `operator`; | ||
} | ||
init(_ lefthandValue: CGExpression, _ righthandValue: CGExpression, _ operatorString: String) { | ||
LefthandValue = lefthandValue | ||
RighthandValue = righthandValue | ||
OperatorString = operatorString; | ||
} | ||
} | ||
|
||
public enum CGOperatorKind { | ||
case Addition | ||
case Subtraction | ||
case Multiplication | ||
case Division | ||
case LegacyPascalDivision // "div" | ||
case Modulus | ||
case Equals | ||
case NotEquals | ||
case LessThan | ||
case LessThanOrEquals | ||
case GreaterThan | ||
case GreatThanOrEqual | ||
case LogicalAnd | ||
case LogicalOr | ||
case LogicalXor | ||
case Shl | ||
case Shr | ||
case BitwiseAnd | ||
case BitwiseOr | ||
case Bitwiseor | ||
case Implies /* Oxygene only */ | ||
case Is | ||
case IsNot | ||
case In /* Oxygene only */ | ||
case NotIn | ||
/*case Assign | ||
case AssignAddition | ||
case AssignSubtraction | ||
case AssignMultiplication | ||
case AssignDivision | ||
case AssignModulus | ||
case AssignBitwiseAnd | ||
case AssignBitwiseOr | ||
case AssignBitwiseXor | ||
case AssignShl | ||
case AssignShr*/ | ||
} | ||
|
||
|
||
/* Literal Expressions */ | ||
|
||
public class CGNamedIdenfifierExpression: CGExpression { | ||
var Name: String | ||
|
||
init(_ name: String) { | ||
Name = name; | ||
} | ||
} | ||
|
||
public class CGSelfExpression: CGExpression { // "self" or "this" | ||
} | ||
|
||
public class CGNilExpression: CGExpression { // "nil" or "null" | ||
} | ||
|
||
public class CGPropertyValueExpression: CGExpression { /* "value" or "newValue" in C#/Swift */ | ||
} | ||
|
||
public class CGLiteralExpression: CGExpression { | ||
} | ||
|
||
public class CGStringLiteralExpression: CGLiteralExpression { | ||
var value: String = "" | ||
} | ||
|
||
public class CGCharacterLiteralExpression: CGLiteralExpression { | ||
var value: Char = "\0" | ||
} | ||
|
||
public class CGIntegerLiteralExpression: CGLiteralExpression { | ||
var Value: Int64 = 0 | ||
} | ||
|
||
public class CGFloatLiteralExpression: CGLiteralExpression { | ||
var Value: Double = 0 | ||
} | ||
|
||
public class CGFBooleanLiteralExpression: CGLiteralExpression { | ||
var Value: Boolean = false | ||
} | ||
|
||
public enum CGArrayLiteralExpressionKind { | ||
case Static | ||
case Dynamic | ||
case HighLevel /* Swift only */ | ||
} | ||
|
||
public class CGArrayLiteralExpression: CGLiteralExpression { | ||
public var ArrayKind: CGArrayLiteralExpressionKind = .Dynamic | ||
//incomplete | ||
} | ||
|
||
public class CGDictionaryLiteralExpression: CGLiteralExpression { /* Swift only */ | ||
} |
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,18 @@ | ||
# CodeGen4 | ||
|
||
An open source cross-platform, language agnostic code generation engine that will drive the future code generation in | ||
RemObjects products such as RemObjects SDK, Data Abstract and Elements | ||
|
||
## Platform support: | ||
|
||
* .NET, Java and Cocoa, va the Elements compiler | ||
|
||
## Language Support | ||
|
||
* Oxygene, Hydrogene, Silver | ||
* Objective-C | ||
* Java | ||
* Visual C#, Visual Basic | ||
* Delphi, C++ Builder | ||
|
||
Implemented with [RemObjects Silver](http://elementscompiler.com/silver). |
Oops, something went wrong.