Formal name for left/right-hand-side of an expression

Given an expression, such as int x = y + 5, we’d call int x the left-hand side (or LHS), and y + 5 the right-hand side (or RHS). The whole expression is called, of course, an expression (or equation), but is there a generic term for a “side” of an expression?

LHS and RHS don’t quite cut it when it comes to an expression such as int x = y = 5 (gloss over the fact here that such assignments are generally bad practice!).

I’m toying with the term component to describe any “side”, but was interested to see if there was a formal standard term already in use. Wikipedia only has “Sides of an equation”, any better suggestions?

10

I think you’re looking for the word operand. A unary operator has one operand. A binary operator has two operands; if the operator is infix, i.e. if the expression is written horizontally with the operator between the two operands, then the operands are known as the left-hand side and right-hand side (very commonly abbreviated LHS and RHS). There are other names when the operator is written differently, for example numerator and denominator for the fraction operator arranged vertically and marked by a horizontal bar. A ternary operator has three operands (which don’t have standard names; if they’re written from left to right, you might call them left, middle and right operand), and so on.

Assuming C, x ? y : z has three operands for the ?: operator which are x, y and z. The syntactic element int x = y = 5 is not parsed as an expression with a single operator; x, y and z are subexpressions but so is y = 5. y and 5 are operands of the operator =. There is no generic term to designate x and y = 5 here: in general parsing terminology, they are operands of the declaration operator, but in C terminology, the word operand is reserved for things that C calls operators.

If you want to treat int _ = _ = _ as a single unit (which isn’t how C syntax works), you can refer to the pieces as the left, middle and right subterms.

The word subterm can be used more or less interchangeably with subexpression in general parsing literature, but specific languages often make a difference between the two (often an expression is a particular kind of term, but occasionally it’s the opposite). You can refer to subterms which are one step down from a node in the parse tree as immediate subterms.

A term that cannot be decomposed any further is an atom.

0

IIRC from my high school days (some SIXTY years ago!), the left-hand side was called the comparator, and the right-hand side was called the “comparand”.

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa

Formal name for left/right-hand-side of an expression

Given an expression, such as int x = y + 5, we’d call int x the left-hand side (or LHS), and y + 5 the right-hand side (or RHS). The whole expression is called, of course, an expression (or equation), but is there a generic term for a “side” of an expression?

LHS and RHS don’t quite cut it when it comes to an expression such as int x = y = 5 (gloss over the fact here that such assignments are generally bad practice!).

I’m toying with the term component to describe any “side”, but was interested to see if there was a formal standard term already in use. Wikipedia only has “Sides of an equation”, any better suggestions?

10

I think you’re looking for the word operand. A unary operator has one operand. A binary operator has two operands; if the operator is infix, i.e. if the expression is written horizontally with the operator between the two operands, then the operands are known as the left-hand side and right-hand side (very commonly abbreviated LHS and RHS). There are other names when the operator is written differently, for example numerator and denominator for the fraction operator arranged vertically and marked by a horizontal bar. A ternary operator has three operands (which don’t have standard names; if they’re written from left to right, you might call them left, middle and right operand), and so on.

Assuming C, x ? y : z has three operands for the ?: operator which are x, y and z. The syntactic element int x = y = 5 is not parsed as an expression with a single operator; x, y and z are subexpressions but so is y = 5. y and 5 are operands of the operator =. There is no generic term to designate x and y = 5 here: in general parsing terminology, they are operands of the declaration operator, but in C terminology, the word operand is reserved for things that C calls operators.

If you want to treat int _ = _ = _ as a single unit (which isn’t how C syntax works), you can refer to the pieces as the left, middle and right subterms.

The word subterm can be used more or less interchangeably with subexpression in general parsing literature, but specific languages often make a difference between the two (often an expression is a particular kind of term, but occasionally it’s the opposite). You can refer to subterms which are one step down from a node in the parse tree as immediate subterms.

A term that cannot be decomposed any further is an atom.

0

IIRC from my high school days (some SIXTY years ago!), the left-hand side was called the comparator, and the right-hand side was called the “comparand”.

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật