Record Class Names
java.lang.Object
java.lang.Record
org.clafer.frontend.Names
- Record Components:
clafers- the clafers of the model, enumerations and their literals included, in declaration orderuses- the clafer each written name refers to, by the name's span
public record Names(List<Symbols.ClaferSymbol> clafers, Map<SourceSpan, Symbols.ClaferSymbol> uses)
extends Record
What the names of a model refer to, for the language server: the clafers,
whose
Symbols.ClaferSymbol.nameSpan() is where each is declared, and the
clafer that each written name refers to, by the span of the name.
The names are those of the constraints, assertions, objectives, initial
values and reference targets, as the resolver resolves them, and those of
the supers and the references to a clafer by name, as the symbols resolve
them. In a path a.b or
A\b, each name has its own span. The special names (this,
parent, dref, ...), the primitive types and the locals of
quantifiers and let are not in it. The spans are in the lines of
the model, the files of its imports first (ModelFiles.position(int)).
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNames(List<Symbols.ClaferSymbol> clafers, Map<SourceSpan, Symbols.ClaferSymbol> uses) Creates an instance of aNamesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionclafers()Returns the value of theclafersrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static booleanisClaferName(String name) final StringtoString()Returns a string representation of this record class.uses()Returns the value of theusesrecord component.
-
Field Details
-
None
-
-
Constructor Details
-
Method Details
-
isClaferName
- Parameters:
name- a word- Returns:
- whether a clafer or a local can be named so: it lexes as one name, and it is neither a reserved word nor one of the words that no clafer can be named
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
clafers
-
uses
-