mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-03 23:55:04 +08:00
35 lines
950 B
JavaScript
Executable File
35 lines
950 B
JavaScript
Executable File
import P from "parsernostrum"
|
|
import GuidEntity from "./GuidEntity.js"
|
|
import IEntity from "./IEntity.js"
|
|
import SymbolEntity from "./SymbolEntity.js"
|
|
|
|
export default class PinReferenceEntity extends IEntity {
|
|
|
|
static grammar = this.createGrammar()
|
|
|
|
/**
|
|
* @param {SymbolEntity} objectName
|
|
* @param {GuidEntity} pinGuid
|
|
*/
|
|
constructor(objectName = null, pinGuid = null) {
|
|
super()
|
|
this.objectName = objectName
|
|
this.pinGuid = pinGuid
|
|
}
|
|
|
|
/** @returns {P<PinReferenceEntity>} */
|
|
static createGrammar() {
|
|
return P.seq(
|
|
SymbolEntity.grammar,
|
|
P.whitespace,
|
|
GuidEntity.grammar
|
|
)
|
|
.map(([objectName, _1, pinGuid]) => new this(objectName, pinGuid))
|
|
.label("PinReferenceEntity")
|
|
}
|
|
|
|
doSerialize() {
|
|
return this.objectName.serialize() + " " + this.pinGuid.serialize()
|
|
}
|
|
}
|