Files
CHOMPStation2/code/modules/scripting/AST/Operators/Binary Operators.dm
vageyenaman@gmail.com bbe42a34d8 More work done on Telecomms:
▫ Signals can now be rejected by Subspace broadcasters through a specific data[] parameter.
▫ Improved the log browser.
▫ Log browsers and telecommunication monitors no longer require access to use. You do need access to delete logs, however.
▫ Intercoms need power to work. They don't drain power, they just need a constant flow of equipment power. As such, that offline intercom sprite's now finally being put to use.

Scripting language:

▫ Sorry about all the files; they're all necessary! It's important to notice that the basic structure of the scripting language code is not mine; I cannibalized the base structure from some obscure BYOND project. It's pretty well documented, and I'd say easier to browse through than atmos. Here's the basic deal:

A compiler datum manages the relationships between the three main subsystems of a scripting language: the Scanner, the Parser, and the Interpreter. The Scanner splits raw text into token datums that the Parser can read. The Parser transforms the otherwise random bits and strings into ordered AST Trees and nodes for the Interpreter to read. The interpreter actually executes the code and handles scope/functions/code blocks.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3193 316c924e-a436-60f5-8080-3fe189b3f50e
2012-02-28 17:36:18 -07:00

173 lines
2.3 KiB
Plaintext

/*
File: Binary Operators
*/
/*
Class: binary
Represents a binary operator in the AST. A binary operator takes two operands (ie x and y) and returns a value.
*/
/node/expression/operator/binary
var
node/expression/exp2
////////// Comparison Operators //////////
/*
Class: Equal
Returns true if x = y.
*/
//
Equal
precedence=OOP_EQUAL
/*
Class: NotEqual
Returns true if x and y aren't equal.
*/
//
NotEqual
precedence=OOP_EQUAL
/*
Class: Greater
Returns true if x > y.
*/
//
Greater
precedence=OOP_COMPARE
/*
Class: Less
Returns true if x < y.
*/
//
Less
precedence=OOP_COMPARE
/*
Class: GreaterOrEqual
Returns true if x >= y.
*/
//
GreaterOrEqual
precedence=OOP_COMPARE
/*
Class: LessOrEqual
Returns true if x <= y.
*/
//
LessOrEqual
precedence=OOP_COMPARE
////////// Logical Operators //////////
/*
Class: LogicalAnd
Returns true if x and y are true.
*/
//
LogicalAnd
precedence=OOP_AND
/*
Class: LogicalOr
Returns true if x, y, or both are true.
*/
//
LogicalOr
precedence=OOP_OR
/*
Class: LogicalXor
Returns true if either x or y but not both are true.
*/
//
LogicalXor //Not implemented in nS
precedence=OOP_OR
////////// Bitwise Operators //////////
/*
Class: BitwiseAnd
Performs a bitwise and operation.
Example:
011 & 110 = 010
*/
//
BitwiseAnd
precedence=OOP_BIT
/*
Class: BitwiseOr
Performs a bitwise or operation.
Example:
011 | 110 = 111
*/
//
BitwiseOr
precedence=OOP_BIT
/*
Class: BitwiseXor
Performs a bitwise exclusive or operation.
Example:
011 xor 110 = 101
*/
//
BitwiseXor
precedence=OOP_BIT
////////// Arithmetic Operators //////////
/*
Class: Add
Returns the sum of x and y.
*/
//
Add
precedence=OOP_ADD
/*
Class: Subtract
Returns the difference of x and y.
*/
//
Subtract
precedence=OOP_ADD
/*
Class: Multiply
Returns the product of x and y.
*/
//
Multiply
precedence=OOP_MULTIPLY
/*
Class: Divide
Returns the quotient of x and y.
*/
//
Divide
precedence=OOP_MULTIPLY
/*
Class: Power
Returns x raised to the power of y.
*/
//
Power
precedence=OOP_POW
/*
Class: Modulo
Returns the remainder of x / y.
*/
//
Modulo
precedence=OOP_MULTIPLY