import FrontCalculatorParserToken from "./front.calculator.parser.token"; import FrontCalculatorSymbolNumber from "../symbol/front.calculator.symbol.number"; import FrontCalculatorSymbolOpeningBracket from "../symbol/brackets/front.calculator.symbol.opening.bracket"; import FrontCalculatorSymbolClosingBracket from "../symbol/brackets/front.calculator.symbol.closing.bracket"; import FrontCalculatorSymbolFunctionAbstract from "../symbol/abstract/front.calculator.symbol.function.abstract"; import FrontCalculatorSymbolOperatorAbstract from "../symbol/abstract/front.calculator.symbol.operator.abstract"; import FrontCalculatorSymbolSeparator from "../symbol/front.calculator.symbol.separator"; import FrontCalculatorParserNodeSymbol from "./node/front.calculator.parser.node.symbol"; import FrontCalculatorParserNodeContainer from "./node/front.calculator.parser.node.container"; import FrontCalculatorParserNodeFunction from "./node/front.calculator.parser.node.function"; /** * The parsers has one important method: parse() * It takes an array of tokens as input and * returns an array of nodes as output. * These nodes are the syntax tree of the term. * */ export default class FrontCalculatorParser { /** * * @param {FrontCalculatorSymbolLoader} symbolLoader */ constructor(symbolLoader) { /** * * @type {FrontCalculatorSymbolLoader} */ this.symbolLoader = symbolLoader; } /** * Parses an array with tokens. Returns an array of nodes. * These nodes define a syntax tree. * * @param {FrontCalculatorParserToken[]} tokens * * @returns FrontCalculatorParserNodeContainer */ parse(tokens) { var symbolNodes = this.detectSymbols(tokens); var nodes = this.createTreeByBrackets(symbolNodes); nodes = this.transformTreeByFunctions(nodes); this.checkGrammar(nodes); // Wrap the nodes in an array node. return new FrontCalculatorParserNodeContainer(nodes); } /** * Creates a flat array of symbol nodes from tokens. * * @param {FrontCalculatorParserToken[]} tokens * @returns {FrontCalculatorParserNodeSymbol[]} */ detectSymbols(tokens) { var symbolNodes = []; var symbol = null; var identifier = null; var expectingOpeningBracket = false; // True if we expect an opening bracket (after a function name) var openBracketCounter = 0; for (var i = 0; i < tokens.length; i++) { var token = tokens[i]; var type = token.type; if (FrontCalculatorParserToken.TYPE_WORD === type) { identifier = token.value; symbol = this.symbolLoader.find(identifier); if (null === symbol) { throw ('Error: Detected unknown or invalid string identifier: ' + identifier + '.'); } } else if (type === FrontCalculatorParserToken.TYPE_NUMBER) { // Notice: Numbers do not have an identifier var symbolNumbers = this.symbolLoader.findSubTypes(FrontCalculatorSymbolNumber); if (symbolNumbers.length < 1 || !(symbolNumbers instanceof Array)) { throw ('Error: Unavailable number symbol processor.'); } symbol = symbolNumbers[0]; } else {// Type Token::TYPE_CHARACTER: identifier = token.value; symbol = this.symbolLoader.find(identifier); if (null === symbol) { throw ('Error: Detected unknown or invalid string identifier: ' + identifier + '.'); } if (symbol instanceof FrontCalculatorSymbolOpeningBracket) { openBracketCounter++; } if (symbol instanceof FrontCalculatorSymbolClosingBracket) { openBracketCounter--; // Make sure there are not too many closing brackets if (openBracketCounter < 0) { throw ('Error: Found closing bracket that does not have an opening bracket.'); } } } if (expectingOpeningBracket) { if (!(symbol instanceof FrontCalculatorSymbolOpeningBracket)) { throw ('Error: Expected opening bracket (after a function) but got something else.'); } expectingOpeningBracket = false; } else { if (symbol instanceof FrontCalculatorSymbolFunctionAbstract) { expectingOpeningBracket = true; } } var symbolNode = new FrontCalculatorParserNodeSymbol(token, symbol); symbolNodes.push(symbolNode); } // Make sure the term does not end with the name of a function but without an opening bracket if (expectingOpeningBracket) { throw ('Error: Expected opening bracket (after a function) but reached the end of the term'); } // Make sure there are not too many opening brackets if (openBracketCounter > 0) { throw ('Error: There is at least one opening bracket that does not have a closing bracket'); } return symbolNodes; } /** * Expects a flat array of symbol nodes and (if possible) transforms * it to a tree of nodes. Cares for brackets. * Attention: Expects valid brackets! * Check the brackets before you call this method. * * @param {FrontCalculatorParserNodeSymbol[]} symbolNodes * @returns {FrontCalculatorParserNodeAbstract[]} */ createTreeByBrackets(symbolNodes) { var tree = []; var nodesInBracket = []; // AbstractSymbol nodes inside level-0-brackets var openBracketCounter = 0; for (var i = 0; i < symbolNodes.length; i++) { var symbolNode = symbolNodes[i]; if (!(symbolNode instanceof FrontCalculatorParserNodeSymbol)) { throw ('Error: Expected symbol node, but got "' + symbolNode.constructor.name + '"'); } if (symbolNode.symbol instanceof FrontCalculatorSymbolOpeningBracket) { openBracketCounter++; if (openBracketCounter > 1) { nodesInBracket.push(symbolNode); } } else if (symbolNode.symbol instanceof FrontCalculatorSymbolClosingBracket) { openBracketCounter--; // Found a closing bracket on level 0 if (0 === openBracketCounter) { var subTree = this.createTreeByBrackets(nodesInBracket); // Subtree can be empty for example if the term looks like this: "()" or "functioname()" // But this is okay, we need to allow this so we can call functions without a parameter tree.push(new FrontCalculatorParserNodeContainer(subTree)); nodesInBracket = []; } else { nodesInBracket.push(symbolNode); } } else { if (0 === openBracketCounter) { tree.push(symbolNode); } else { nodesInBracket.push(symbolNode); } } } return tree; } /** * Replaces [a SymbolNode that has a symbol of type AbstractFunction, * followed by a node of type ContainerNode] by a FunctionNode. * Expects the $nodes not including any function nodes (yet). * * @param {FrontCalculatorParserNodeAbstract[]} nodes * * @returns {FrontCalculatorParserNodeAbstract[]} */ transformTreeByFunctions(nodes) { var transformedNodes = []; var functionSymbolNode = null; for (var i = 0; i < nodes.length; i++) { var node = nodes[i]; if (node instanceof FrontCalculatorParserNodeContainer) { var transformedChildNodes = this.transformTreeByFunctions(node.childNodes); if (null !== functionSymbolNode) { var functionNode = new FrontCalculatorParserNodeFunction(transformedChildNodes, functionSymbolNode); transformedNodes.push(functionNode); functionSymbolNode = null; } else { // not a function node.childNodes = transformedChildNodes; transformedNodes.push(node); } } else if (node instanceof FrontCalculatorParserNodeSymbol) { var symbol = node.symbol; if (symbol instanceof FrontCalculatorSymbolFunctionAbstract) { functionSymbolNode = node; } else { transformedNodes.push(node); } } else { throw ('Error: Expected array node or symbol node, got "' + node.constructor.name + '"'); } } return transformedNodes; } /** * Ensures the tree follows the grammar rules for terms * * @param {FrontCalculatorParserNodeAbstract[]} nodes */ checkGrammar(nodes) { // TODO Make sure that separators are only in the child nodes of the array node of a function node // (If this happens the calculator will throw an exception) for (var i = 0; i < nodes.length; i++) { var node = nodes[i]; if (node instanceof FrontCalculatorParserNodeSymbol) { var symbol = node.symbol; if (symbol instanceof FrontCalculatorSymbolOperatorAbstract) { var posOfRightOperand = i + 1; // Make sure the operator is positioned left of a (potential) operand (=prefix notation). // Example term: "-1" if (posOfRightOperand >= nodes.length) { throw ('Error: Found operator that does not stand before an operand.'); } var posOfLeftOperand = i - 1; var leftOperand = null; // Operator is unary if positioned at the beginning of a term if (posOfLeftOperand >= 0) { leftOperand = nodes[posOfLeftOperand]; if (leftOperand instanceof FrontCalculatorParserNodeSymbol) { if (leftOperand.symbol instanceof FrontCalculatorSymbolOperatorAbstract // example 1`+-`5 : + = operator, - = unary || leftOperand.symbol instanceof FrontCalculatorSymbolSeparator // example func(1`,-`5) ,= separator, - = unary ) { // Operator is unary if positioned right to another operator leftOperand = null; } } } // If null, the operator is unary if (null === leftOperand) { if (!symbol.operatesUnary) { throw ('Error: Found operator in unary notation that is not unary.'); } // Remember that this node represents a unary operator node.setIsUnaryOperator(true); } else { if (!symbol.operatesBinary) { console.log(symbol); throw ('Error: Found operator in binary notation that is not binary.'); } } } } else { this.checkGrammar(node.childNodes); } } } }.tx-content-switcher-toggle-switch-label{position:relative;display:inline-block;width:60px;height:34px}.tx-content-switcher-toggle-switch-label input{opacity:0;width:0;height:0}.tx-content-switcher-toggle-switch-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:.4s;transition:.4s;display:block;border-style:solid}.tx-content-switcher-toggle-switch-slider:before{position:absolute;content:"";height:26px;width:26px;left:0;top:50%;transform:translateY(-50%);background-color:#fff;-webkit-transition:.4s;transition:.4s}input:checked+.tx-content-switcher-toggle-switch-slider{background-color:#2196f3}input:focus+.tx-content-switcher-toggle-switch-slider{box-shadow:0 0 1px #2196f3}input:checked+.tx-content-switcher-toggle-switch-slider:before{-webkit-transform:translate(34px,-50%);-ms-transform:translate(34px,-50%);transform:translate(34px,-50%)}.tx-content-switcher-toggle-inner{display:flex;align-items:center;flex-direction:row;padding:30px 0}.tx-content-switcher-toggle.tx_switecher_left{justify-content:flex-start;display:flex}.tx-content-switcher-toggle.tx_switecher_center{justify-content:center;display:flex}.tx-content-switcher-toggle.tx_switecher_right{justify-content:flex-end;display:flex}.tx-content-switcher-toggle.tx_switecher_justify{display:block}.tx-content-switcher-toggle.tx_switecher_justify .tx-content-switcher-toggle-inner{justify-content:center}.tx-content-switcher-toggle-label-1,.tx-content-switcher-toggle-label-2{cursor:pointer}{"id":1944,"date":"2025-03-08T04:28:51","date_gmt":"2025-03-08T04:28:51","guid":{"rendered":"https:\/\/makemyasset.in\/?p=1944"},"modified":"2025-03-08T04:28:51","modified_gmt":"2025-03-08T04:28:51","slug":"awkward-greetings-and-covid-bubbles-navigating-the-twilight-region-in-the-pandemic-brigid-delaney","status":"publish","type":"post","link":"https:\/\/makemyasset.in\/?p=1944","title":{"rendered":"Awkward greetings and Covid bubbles: navigating the twilight region in the pandemic | Brigid Delaney |"},"content":{"rendered":"
\n
\n
\n

\n We’re currently in a weird twilight area: pre-vaccine but on the road to reopening.\n <\/p>\n

\n These are the Covid teenage many years \u00e2\u0080\u0093 we are all limbs and arms while we try to workout a new way of being in the field. We bumble along, we make some mistakes \u00e2\u0080\u0093 someday we’re going to chuckle! But nowadays, things are weird.\n <\/p>\n<\/p>\n

<\/p>\n

\n
\n Online Dating
\n <\/strong>
\n <\/h2>\n

<\/span><\/p>\n

\n You simply started dating Harry and it’s heading well thinking about lots of your own past relationships have actually collapsed during the 30 days tag after your insistence which they FULLY DEVOTE.\n <\/p>\n

\n <\/figure>\n

\n The good news is, with Covid, being
\n
\n Covid-safe,
\n <\/em>
\n you’ve got the right \u00e2\u0080\u0093 wait no! \u00e2\u0080\u0093 the obligation to set all the way down a couple of public wellness directions. Making sure that’s a no to polyamory, circular matchmaking, threesomes, orgy adelaide<\/a>, flatmates and female friends. In Reality, as you suggest to Harry on the third time, maybe you should only move in rather than see anybody else socially or perhaps ever, because \u00e2\u0080\u00a6 Covid.\n <\/p>\n

<\/p>\n

\n
\n The pub
\n <\/strong>
\n <\/h2>\n

<\/span><\/p>\n

\n You’ve got a bad back, you ought to stand \u00e2\u0080\u0093 Covid marshal states no.\n <\/p>\n

\n You understood your club days might stop one-day, for explanations possibly of misbehaviour, although thought that you now cannot go right to the club as you have actually a terrible straight back, and are unable to extend it, is actually unexpectedly sad.\n <\/p>\n

<\/p>\n

\n
\n Greetings
\n <\/strong>
\n <\/h2>\n

<\/span><\/p>\n

\n In my opinion she is planning for the embrace. I thought these weren’t enabled! We have my shoulder down, ready for bump \u00e2\u0080\u0093 and even though i am self-conscious as it looks like those types of defensive postures you learn in females’s self defence classes \u00e2\u0080\u00a6 wait \u00e2\u0080\u0093 it truly looks like she actually is choosing the hug, although maybe its an air hug or she’s going to rotate to kiss in the cheek \u00e2\u0080\u0093 omg that is stressful \u00e2\u0080\u0093 she’s obtaining closer, possibly We’ll stab inside her the boob with the point of my elbow or my personal arm will have wedged in her upper body through the hug. Perhaps i will state something \u00e2\u0080\u0093 yes today! “Sorry, I am not hugging \u00e2\u0080\u00a6 until there is a vaccine.”\n <\/p>\n

<\/p>\n

\n
\n Vacations
\n <\/strong>
\n <\/h2>\n

<\/span><\/p>\n

\n The region is on fire therefore we’ve had no visitors since January. Most people are depressed and broke therefore need website visitors. In fact \u00e2\u0080\u0093 no \u00e2\u0080\u0093 you shouldn’t come!! You’ll bring the plague with you and now we’ll have a cluster and get from the news immediately after which we will get no website visitors and everyone is broke and depressed, plus the whole state know the names of this Thai bistro as well as the RSL, because they becomes the brands of a large, well-known group \u00e2\u0080\u00a6 and extremely, just who mentioned all publicity is right promotion?\n <\/p>\n

<\/p>\n

\n
\n Friendships
\n <\/strong>
\n <\/h2>\n

<\/span><\/p>\n

\n You have not severely seriously considered the thought of
\n
\n choosing a most readily useful friend
\n <\/em>
\n since major college, however Bryony features expected you to end up being the woman closest friend. “are you gonna be within my ripple?” she requires. You’re flattered but astonished. You don’t know Bryony that really. An old associate, you’ve merely hung down a few instances outside of the office. You have not even place their quantity in your telephone. You had just ask this lady to be in your ripple if every person you realized passed away. The asymmetrical character regarding the friendship unnerves you. You reach considering: “let’s say the person I inquired to stay my personal ripple was freaked-out at
\n
\n my personal
\n <\/em>
\n request?” You begin to concern every friendship you have ever endured. Will you be someone’s Bryony?\n <\/p>\n

<\/p>\n

\n
\n Events
\n <\/strong>
\n <\/h2>\n

<\/span><\/p>\n

\n Limitations have alleviated in New South Wales and you are clearly hosting an event for 20 of nearest buddies. The event, presented outside in your lawn, is actually Covid as well as has actually a no-Instagram rule so friends in Victoria don’t get induced.\n <\/p>\n

\n But at 9pm your own friend Maria arises together friend Debbie \u00e2\u0080\u0093 whom you have not invited.\n <\/p>\n

\n Debbie is actually weeping because she has merely already been dumped by her sweetheart.\n <\/p>\n

\n “I couldn’t keep this lady alone during the club, crying. C’mon, it’s simply anyone. Have actually a heart!!” states Maria.\n <\/p>\n

\n With 21 guests at your residence, you and your visitors have become exposed to the chance of a sizable good. All-night you’re on side. You substitute your kitchen performing continuous mind matters, you motivate people to take a brief break from party \u00e2\u0080\u0093 “go off to a bar, I’ll content you whenever an area reveals!” \u00e2\u0080\u0093 but mostly you spend time seething at Debbie, which looks GOOD rather than at all heartbroken.\n <\/p>\n

\n <\/figure>\n

<\/p>\n

\n
\n Workout
\n <\/strong>
\n <\/h2>\n

<\/span><\/p>\n

\n You establish on a walk behind home which will take you across a greens and a vacant playing industry until you can a main path. You are halfway over the greens when you realize you’ve kept your mandatory mask at home! You believed you had one out of your pocket nevertheless had been an old tissue.\n <\/p>\n

\n Just the other day an associate you have was actually abused on the street for having their particular mask hanging down around their chin. People got images of him and threatened to share them on Facebook!\n <\/p>\n

\n Without a mask, your options consist of staying in the midst of the golf course, concealing within the bunker until it will get dark colored adequate that nobody sees you when you walk house, finishing the walk in any event \u00e2\u0080\u0093 and risking a big fine and personal shaming, ripping your clothing and fashioning a nose and mouth mask, moving along the fairway in an action that will obscure that person and mistake additional walkers, or working home rapidly (or according to research by the legislation “strenuously”), without stopping.\n <\/p>\n

\n How to handle it? This is the problem. You never know what to-do about something, any longer.\n <\/p>\n<\/p><\/div>\n<\/p><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"

We’re currently in a weird twilight area: pre-vaccine but on the road to reopening. These are the Covid teenage many years \u00e2\u0080\u0093 we are all limbs and arms while we try to workout a new way of being in the field. We bumble along, we make some mistakes \u00e2\u0080\u0093 someday we’re going to chuckle! But […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[305],"tags":[],"class_list":["post-1944","post","type-post","status-publish","format-standard","hentry","category-blog"],"acf":[],"_links":{"self":[{"href":"https:\/\/makemyasset.in\/index.php?rest_route=\/wp\/v2\/posts\/1944","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/makemyasset.in\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/makemyasset.in\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/makemyasset.in\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/makemyasset.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1944"}],"version-history":[{"count":1,"href":"https:\/\/makemyasset.in\/index.php?rest_route=\/wp\/v2\/posts\/1944\/revisions"}],"predecessor-version":[{"id":1945,"href":"https:\/\/makemyasset.in\/index.php?rest_route=\/wp\/v2\/posts\/1944\/revisions\/1945"}],"wp:attachment":[{"href":"https:\/\/makemyasset.in\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1944"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/makemyasset.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1944"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/makemyasset.in\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1944"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}