Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

Commit

Permalink
Reverted unfinished changes in C generator for array type handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
tkutz committed Jul 14, 2016
1 parent 5997050 commit f039069
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,25 @@ class ExpressionCode {

def dispatch CharSequence code(Expression it, VariableDefinition target) '''«target.access»'''

def dispatch CharSequence code(ElementReferenceExpression it, VariableDefinition target) '''«target.access»«FOR arrSel : arraySelector»[«arrSel.code»]«ENDFOR»'''
def dispatch CharSequence code(ElementReferenceExpression it, VariableDefinition target) '''«target.access»'''

def dispatch CharSequence code(FeatureCall it, VariableDefinition target) '''«target.access»«FOR arrSel : arraySelector»[«arrSel.code»]«ENDFOR»'''
def dispatch CharSequence code(FeatureCall it, VariableDefinition target) '''«target.access»'''

def dispatch CharSequence code(ElementReferenceExpression it, OperationDefinition target) '''«target.access»(«scHandle»«FOR arg : args BEFORE ', ' SEPARATOR ', '»«arg.
code»«ENDFOR»)'''

def dispatch CharSequence code(ElementReferenceExpression it, Operation target) '''«target.access»(«FOR arg : args SEPARATOR ', '»«arg.
code»«ENDFOR»)'''

def dispatch CharSequence code(ElementReferenceExpression it, org.yakindu.base.types.Property target) '''«target.access»«FOR arrSel : arraySelector»[«arrSel.code»]«ENDFOR»'''
def dispatch CharSequence code(ElementReferenceExpression it, org.yakindu.base.types.Property target) '''«target.access»'''

def dispatch CharSequence code(FeatureCall it, OperationDefinition target) '''«target.access»(«scHandle»«FOR arg : args BEFORE ', ' SEPARATOR ', '»«arg.
code»«ENDFOR»)'''

def dispatch CharSequence code(FeatureCall it, Operation target) '''«it.owner.code».«target.access»(«FOR arg : args SEPARATOR ', '»«arg.
code»«ENDFOR»)'''

def dispatch CharSequence code(FeatureCall it, org.yakindu.base.types.Property target) '''«it.owner.code».«target.access»«FOR arrSel : arraySelector»[«arrSel.code»]«ENDFOR»'''
def dispatch CharSequence code(FeatureCall it, org.yakindu.base.types.Property target) '''«it.owner.code».«target.access»'''

def dispatch CharSequence code(FeatureCall it, Enumerator target) '''«target.access»'''

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ import org.yakindu.sct.model.stext.stext.StatechartScope
import org.yakindu.sct.model.stext.stext.VariableDefinition

import static org.eclipse.xtext.util.Strings.*
import org.yakindu.base.types.typesystem.ITypeSystem
import org.yakindu.base.types.TypeSpecifier
import org.yakindu.base.types.ArrayTypeSpecifier

class StatemachineHeader implements IContentTemplate {

Expand All @@ -39,8 +36,6 @@ class StatemachineHeader implements IContentTemplate {
@Inject extension GenmodelEntries
@Inject extension INamingService

@Inject extension ITypeSystem

@Inject @Named(IGenArtifactConfigurations.DEFAULT)
IGenArtifactConfigurations defaultConfigs

Expand Down Expand Up @@ -146,19 +141,11 @@ class StatemachineHeader implements IContentTemplate {
'''
def dispatch scopeTypeDeclMember(VariableDefinition it) '''
«IF type.isArrayType»
«typeSpecifier.typeArguments.get(0).type.name» «name.asEscapedIdentifier»[«typeSpecifier.arraySize»];
«ELSE»
«IF type.name != 'void' && !isConst»«type.targetLanguageName» «name.asEscapedIdentifier»;«ENDIF»
«ENDIF»
«IF type.name != 'void' && !isConst»«type.targetLanguageName» «name.asEscapedIdentifier»;«ENDIF»
'''
def dispatch scopeTypeDeclMember(Declaration it) ''''''
def dispatch arraySize(TypeSpecifier it) ''''''
def dispatch arraySize(ArrayTypeSpecifier it) '''«size»'''
def scopeTypeDecl(Scope scope) '''
«val typeRelevantDeclarations = scope.typeRelevantDeclarations.toList»
«IF !typeRelevantDeclarations.empty»
Expand Down

0 comments on commit f039069

Please sign in to comment.