internal override void SemanticValidation(IntermediateRepresentation.Semantic.SemanticContext semanticContext)
        {
            /* Left.SemanticValidation(semanticContext);
            Right.SemanticValidation(semanticContext);

            if (!(Left.GetIRType() is NumericType && Right.GetIRType() is NumericType) || !(Left.GetIRType() == Right.GetIRType()))
            {
                throw new Semantic.SemanticValidationException("No se puede asignar");

            }*/
        }
Example #2
0
    private void CompileOperation(CompileType type)
    {
        var data = Resources.Load <FrpGraphContainer>(_fileName);
        var ir   = IntermediateRepresentation.Create(data);

        switch (type)
        {
        case CompileType.FlapJax:
        {
            FrapjaxCompiler.Print(ir);
            break;
        }

        case CompileType.Sodium:
        {
            SodiumCompiler.Print(ir);
            break;
        }
        }
    }
Example #3
0
        public static void Main()
        {
            Console.WriteLine("\n*** OTF Example ***\n");

            // Load a schema (serialized IR) as if we just got it off the wire (you can create a serialized IR schema with SbeTool)
            byte[] encodedSchemaBuffer = LoadSchema();

            // Encode up a message as if we just got it off the wire
            var encodedMsgBuffer = new byte[MsgBufferCapacity];

            EncodeTestMessage(encodedMsgBuffer);

            // Now lets decode the schema IR so we have IR objects.
            //encodedSchemaBuffer.flip();
            IntermediateRepresentation ir = DecodeIr(encodedSchemaBuffer);

            // From the IR we can create OTF decoder for message headers.
            var headerDecoder = new OtfHeaderDecoder(ir.HeaderStructure);

            // Now we have IR we can read the message header
            int bufferOffset = 0;
            var buffer       = new DirectBuffer(encodedMsgBuffer);

            int templateId    = headerDecoder.GetTemplateId(buffer, bufferOffset);
            int schemaId      = headerDecoder.GetSchemaId(buffer, bufferOffset);
            int actingVersion = headerDecoder.GetSchemaVersion(buffer, bufferOffset);
            int blockLength   = headerDecoder.GetBlockLength(buffer, bufferOffset);

            bufferOffset += headerDecoder.Size;

            // Given the header information we can select the appropriate message template to do the decode.
            // The OTF Java classes are thread safe so the same instances can be reused across multiple threads.

            IList <Token> msgTokens = ir.GetMessage(templateId);

            bufferOffset = OtfMessageDecoder.Decode(buffer, bufferOffset, actingVersion, blockLength, msgTokens,
                                                    new ExampleTokenListener());
        }
 public BitwiseRightShiftAssigExpression(IntermediateRepresentation.Expression left, IntermediateRepresentation.Expression right)
 {
     // TODO: Complete member initialization
     this.left = left;
     this.right = right;
 }
Example #5
0
 internal override void SemanticValidation(IntermediateRepresentation.Semantic.SemanticContext semanticContext)
 {
     //TODO:
 }
Example #6
0
 public ModExpression(IntermediateRepresentation.Expression left, IntermediateRepresentation.Expression right)
 {
     this.Left = left;
     this.Right = right;
 }
 public MultiplicationAsigExpression(IntermediateRepresentation.Expression left, IntermediateRepresentation.Expression right)
 {
     // TODO: Complete member initialization
     this.left = left;
     this.right = right;
 }
Example #8
0
 internal override void SemanticValidation(IntermediateRepresentation.Semantic.SemanticContext semanticContext)
 {
     semanticContext.IdExistInScope(this.id);
     returnType = semanticContext.GetIdType(this.id);
 }
Example #9
0
 internal override void SemanticValidation(IntermediateRepresentation.Semantic.SemanticContext semanticContext)
 {
     throw new NotImplementedException();
 }
Example #10
0
 public EqualsExpression(IntermediateRepresentation.Expression left, IntermediateRepresentation.Expression right)
 {
     // TODO: Complete member initialization
     this.Left = left;
     this.Right = right;
 }