congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
Assignment
Code IndexAdd Tabnine to your IDE (free)

How to use
Assignment
in
org.eclipse.xtext

Best Java code snippets using org.eclipse.xtext.Assignment (Showing top 20 results out of 315)

origin: org.eclipse/xtext

public String getAssignmentName() {
  if (type != ConstraintType.ASSIGNMENT)
    throw new RuntimeException("Constraint '" + this + "' is not an assignment, but a " + getType());
  return ((Assignment) element).getFeature();
}
origin: org.eclipse/xtext

@Override
public Void caseAssignment(Assignment object) {
  if (object.getTerminal() != null)
    return doSwitch(object.getTerminal());
  return null;
}

origin: org.eclipse/xtext

protected String addAssignemnt(String result, AbstractElement ele) {
  if (!showAssignment)
    return result;
  Assignment ass = GrammarUtil.containingAssignment(ele);
  result = ass != null ? ass.getFeature() + ass.getOperator() + result : result;
  return addQualified(result, ele);
}
origin: org.eclipse.xtext/org.eclipse.xtext.xtext.generator

protected boolean _predicated(final Assignment it) {
 return (it.isPredicated() || this.predicated(it.getTerminal()));
}

origin: org.eclipse.xtext/org.eclipse.xtext.xtext.generator

protected boolean _mustBeParenthesized(final Assignment it) {
 return ((this._grammarAccessExtensions.predicated(it) || it.isFirstSetPredicated()) || this.mustBeParenthesized(it.getTerminal()));
}

origin: org.eclipse.xtext/org.eclipse.xtext.xtext.generator

 String _feature = it.getFeature();
 String _feature_1 = assignment.getFeature();
 return Boolean.valueOf(Objects.equal(_feature, _feature_1));
};
final Function1<Assignment, AbstractElement> _function_1 = (Assignment it) -> {
 return it.getTerminal();
};
final List<AbstractElement> terminals = IterableExtensions.<AbstractElement>toList(IterableExtensions.<Assignment, AbstractElement>map(IterableExtensions.<Assignment>filter(GrammarUtil.containedAssignments(GrammarUtil.containingParserRule(assignment)), _function), _function_1));
origin: org.eclipse.xtext/org.eclipse.xtext.xtext.generator

public String setOrAdd(final Assignment it) {
 String _xifexpression = null;
 String _operator = it.getOperator();
 boolean _equals = Objects.equal(_operator, "+=");
 if (_equals) {
  _xifexpression = "add";
 } else {
  _xifexpression = "set";
 }
 return _xifexpression;
}

origin: org.eclipse.xtext/org.eclipse.xtext.ide

protected boolean shouldUseParent(ICompositeNode result, int offset, ILeafNode leaf) {
  if (leaf.getTotalEndOffset() == offset) {
    return true;
  }
  if (result.getGrammarElement() instanceof RuleCall) {
    RuleCall rc = (RuleCall) result.getGrammarElement();
    if (!rc.getArguments().isEmpty()) {
      return true;
    }
    Assignment assignment = GrammarUtil.containingAssignment(rc);
    if (assignment != null
        && (GrammarUtil.isMultipleCardinality(assignment) || (assignment.eContainer() instanceof AbstractElement && GrammarUtil
            .isMultipleCardinality((AbstractElement) assignment.eContainer())))) {
      return true;
    }
  }
  return false;
}
origin: org.eclipse.xtext/org.eclipse.xtext.ide

protected void _createProposals(final Assignment assignment, final ContentAssistContext context, final IIdeContentProposalAcceptor acceptor) {
 final AbstractElement terminal = assignment.getTerminal();
 if ((terminal instanceof CrossReference)) {
  this.createProposals(terminal, context, acceptor);
    boolean _equals = Objects.equal(_name, "STRING");
    if (_equals) {
     String _feature = assignment.getFeature();
     String _plus = ("\"" + _feature);
     _xifexpression = (_plus + "\"");
    } else {
     _xifexpression = assignment.getFeature();
origin: org.eclipse/xtext

public static boolean isBooleanAssignment(Assignment a) {
  return "?=".equals(a.getOperator());
}
origin: org.eclipse.xtext/ui

private String getAssignedFeature(RuleCall call) {
  Assignment ass = GrammarUtil.containingAssignment(call);
  if (ass != null) {
    String result = ass.getFeature();
    if (result.equals(result.toLowerCase()))
      result = Strings.toFirstUpper(result);
    return result;
  }
  return null;
}

origin: org.eclipse.xtext.ui.codetemplates/ui

public void completeCodetemplate_KeywordContext(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
  completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
public void completeCodetemplate_Body(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
origin: org.eclipse/xtext

public void addFeature(Assignment assignment) throws TransformationException {
  final String featureName = assignment.getFeature();
  boolean isMultivalue = GrammarUtil.isMultipleAssignment(assignment);
  boolean isContainment = true;
  EClassifierInfo featureTypeInfo;
  if (GrammarUtil.isBooleanAssignment(assignment)) {
    EDataType eBoolean = GrammarUtil.findEBoolean(GrammarUtil.getGrammar(assignment));
    featureTypeInfo = getEClassifierInfoOrThrowException(eBoolean, assignment);
    isMultivalue = false;
  }
  else {
    AbstractElement terminal = assignment.getTerminal();
    if (terminal == null) {
      throw new TransformationException(TransformationErrorCode.NoSuchTypeAvailable, "Cannot derive type from incomplete assignment.", assignment);
    }
    EClassifier type = getTerminalType(terminal);
    isContainment = isContainmentAssignment(assignment);
    featureTypeInfo = getEClassifierInfoOrThrowException(type, assignment);
  }
  addFeature(featureName, featureTypeInfo, isMultivalue, isContainment, assignment);
}
origin: org.eclipse/xtext

@Override
public String caseAssignment(Assignment object) {
  String result = object.getFeature() + object.getOperator() + " " + card(object);
  return addQualified(result, object);
}
origin: org.eclipse/xtext

public static boolean isSingleAssignment(Assignment a) {
  return "=".equals(a.getOperator());
}
origin: org.eclipse.xtext.ui.codetemplates/ui

private String getAssignedFeature(RuleCall call) {
  Assignment ass = GrammarUtil.containingAssignment(call);
  if (ass != null) {
    String result = ass.getFeature();
    if (result.equals(result.toLowerCase()))
      result = Strings.toFirstUpper(result);
    return result;
  }
  return null;
}

origin: org.eclipse.xtext.ui.codetemplates/ui

public void completeVariable_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
  completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
public void completeVariable_Type(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
origin: org.eclipse.xtext.ui.codetemplates/ui

public void completeNestedAssignment(Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
  String proposalText = "${" + assignment.getFeature() + "}";
  StyledString displayText;
  if (assignment.getTerminal() instanceof RuleCall) {
    RuleCall ruleCall = (RuleCall) assignment.getTerminal();
    AbstractRule calledRule = ruleCall.getRule();
    displayText = new StyledString("${", StyledString.DECORATIONS_STYLER)
      .append(assignment.getFeature(), null)
      .append("}", StyledString.DECORATIONS_STYLER)
      .append(" - ", StyledString.QUALIFIER_STYLER)
      .append(calledRule.getName(), StyledString.COUNTER_STYLER)
      .append(" - Create a new template variable", StyledString.QUALIFIER_STYLER);
  } else {
    displayText = new StyledString("${", StyledString.DECORATIONS_STYLER)
      .append(assignment.getFeature(), null)
      .append("}", StyledString.DECORATIONS_STYLER)
      .append(" - Create a new template variable", StyledString.QUALIFIER_STYLER);
  }
  ICompletionProposal proposal = createCompletionProposal(proposalText, displayText, null, context);
  if (proposal instanceof ConfigurableCompletionProposal) {
    ConfigurableCompletionProposal configurable = (ConfigurableCompletionProposal) proposal;
    configurable.setSelectionStart(configurable.getReplacementOffset() + 2);
    configurable.setSelectionLength(proposalText.length() - 3);
    configurable.setAutoInsertable(false);
    configurable.setSimpleLinkedMode(context.getViewer(), '\t');
    configurable.setPriority(configurable.getPriority() * 2);
  }
  acceptor.accept(proposal);
}

origin: org.eclipse/xtext

public static boolean isMultipleAssignment(Assignment a) {
  return "+=".equals(a.getOperator());
}
origin: org.eclipse.xtext/org.eclipse.xtext.xtext.generator

public String localVar(final Assignment it, final AbstractElement terminal) {
 String _feature = it.getFeature();
 String _plus = ("lv_" + _feature);
 String _plus_1 = (_plus + "_");
 int _indexOf = this.contentsAsList(GrammarUtil.containingParserRule(it)).indexOf(it);
 String _plus_2 = (_plus_1 + Integer.valueOf(_indexOf));
 String _plus_3 = (_plus_2 + "_");
 int _indexOf_1 = EcoreUtil2.eAllContentsAsList(it).indexOf(terminal);
 return (_plus_3 + Integer.valueOf(_indexOf_1));
}

org.eclipse.xtextAssignment

Javadoc

A representation of the model object 'Assignment'.

The following features are supported:

  • org.eclipse.xtext.Assignment#getFeature
  • org.eclipse.xtext.Assignment#getOperator
  • org.eclipse.xtext.Assignment#getTerminal

Most used methods

  • getFeature
    Returns the value of the 'Feature' attribute. If the meaning of the 'Feature' attribute isn't clear,
  • getTerminal
    Returns the value of the 'Terminal' containment reference. If the meaning of the 'Terminal' containm
  • getOperator
    Returns the value of the 'Operator' attribute. If the meaning of the 'Operator' attribute isn't clea
  • eContainer
  • isFirstSetPredicated
  • isPredicated

Popular in Java

  • Running tasks concurrently on multiple threads
  • runOnUiThread (Activity)
  • startActivity (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Collectors (java.util.stream)
  • ImageIO (javax.imageio)
  • BoxLayout (javax.swing)
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now