Defendant took a firearm and other property from his parents’ locked bedroom in the house in which the three of them lived, and was convicted of first-degree burglary, ORS 164.225, first-degree theft, ORS 164.055, second-degree theft, ORS 164.045, and unlawful possession of a firearm, ORS 166.250.1 Defendant contends that the trial court erred in denying his motion for judgment of acquittal (MJOA) on the first-degree burglary charge.2 In defendant’s view, his parents’ locked bedroom is not a dwelling because it is not a separate unit or building from the rest of the house as those terms are defined in the burglary statutes. As explained below, we conclude that the trial court should have granted defendant’s MJOA on the burglary charge and, accordingly, reverse defendant’s conviction for first-degree burglary, remand for resentencing, and otherwise affirm.
“When reviewing a trial court’s denial of a motion for a judgment of acquittal, we view the evidence in the light most favorable to the state.” State v. Werner, 281 Or App 154, 156, 383 P3d 875 (2016). We state the facts consistently with that standard.
Defendant lived with his parents in a three-bedroom house owned by his father, Mendez, and his mother, Ferrer. Defendant had a key to the house and could come and go as he wished. Defendant had his own bedroom, and his parents shared a bedroom. There is no evidence that defendant paid rent to his parents as a condition of living in their home or as consideration for any right to exclusively occupy his bedroom. The third bedroom was used as a guest room.
Mendez installed a deadbolt lock and metal reinforcement on the door to the bedroom he shared with Ferrer. He did so because he and Ferrer kept firearms in the closet in the bedroom and they did not want defendant or anyone else to have access to the firearms when they were not *538present. Only Mendez and Ferrer had keys to their bedroom. Defendant did not have permission to be in his parents’ bedroom when the door was closed, but when Mendez or Ferrer was in the bedroom, defendant was permitted inside. When Mendez was home, his bedroom door was always open. None of the other interior doors of the house had deadbolt locks.
Defendant and his parents had a dispute. As a result, Mendez and Ferrer left the house and spent the night at their daughter’s home. Their bedroom door was locked when they left. Upon returning home the next morning, they discovered that their bedroom door was broken open. Defendant had broken into his parents’ locked bedroom and had taken Mendez’s wallet and a firearm. Defendant was arrested several days later when he came home to return the firearm.
Defendant was charged with burglary in the first degree along with other crimes. As relevant here, the indictment alleged that “defendant * * * did unlawfully and knowingly enter or remain in a dwelling, to-wit: the locked bedroom of [his parents], *** with the intent to commit the crime of theft therein [.] ” and also alleged that, “during the immediate flight from the above-described dwelling, Defendant was armed with a deadly weapon [.] ” The matter proceeded to a jury trial. After the state presented its case, defendant moved for a judgment of acquittal with respect to the first-degree burglary count, arguing that his parents’ bedroom was not a separate unit or building from the rest of the house, and it was therefore not a dwelling under the burglary statutes. The trial court denied defendant’s motion, and the jury found defendant guilty of first-degree burglary and other charged crimes.
Three statutes are pertinent here. ORS 164.225(1) provides, in part:
“A person commits the crime of burglary in the first degree if the person violates ORS 164.215 and the building is a dwelling, or if in effecting entry or while in a building or in immediate flight therefrom the person:
“(a) Is armed with a * * * deadly weapon [.] ”
ORS 164.215(1) states that “a person commits the crime of burglary in the second degree if the person enters or *539remains unlawfully in a building with intent to commit a crime therein.” The terms “building” and “dwelling” are defined by ORS 164.205(1) and (2):
“(1) ‘Building,’ in addition to its ordinary meaning, includes any booth, vehicle, boat, aircraft or other structure adapted for overnight accommodation of persons or for carrying on business therein. Where a building consists of separate units, including, but not limited to, separate apartments, offices or rented rooms, each unit is, in addition to being apart of such building, a separate building.
“(2) ‘Dwelling’ means a building which regularly or intermittently is occupied by a person lodging therein at night, whether or not a person is actually present.”
(Emphasis added.)
There is no question that, if the bedroom is a “building” as defined by ORS 164.205(1), it is a “dwelling” under ORS 164.205(2) because the space was “regularly *** occupied by a person lodging therein at night.” The key issue, then, is whether the bedroom space is a separate “unit” and “building” from the rest of the residential structure. Defendant argues that the locked bedroom at issue is part of a family residence—an integral part of the house—and is not akin to an apartment, a tenement, or a separately rented office or room. Defendant also argues that the bedroom was not a self-contained, “separate unit” from the rest of the house. He points out that he lives in the house with his parents. His parents own the house, but defendant is always welcome there, he has a key to the house, and he may come and go as he wishes. Defendant asserts that his parents put a lock on their bedroom door to prevent defendant or anyone else from having access to the firearms stored there when they were not present. However, when his parents are inside, defendant may enter their bedroom. Thus, according to defendant, the parents’ bedroom is part of a home to which all members have access at certain times, and from which some members are excluded at other times. Although his parents generally occupied the bedroom, defendant was allowed in there when his parents were present, and therefore it was not exclusively occupied by his parents.
In response, the state contends that a bedroom in a house can, under certain circumstances, including the *540circumstances of this case, be a “separate unit” and therefore a “building” for purposes of the burglary statutes, and that the evidence supports such a finding here. The state argues that our case law indicates that, if a room is self-contained from the rest of the house and has secure physical access, a separate function, and a separate occupation, then it is a separate unit. The state further contends that a room within a house can be a separate unit of the house if the occupants of the room use the room for some purpose separate from the rest of the house and have secured physical access to the room from other people, including other residents of the house.
The state argues specifically that the bedroom was self-contained from the house in that it was a distinct part of the greater whole. According to the state, the bedroom had secure physical access through use of a keyed-entry lock and metal reinforcement intended to keep anyone, other than defendant’s parents, out; it had a separate function from the rest of the house because, in addition to being defendant’s parents’ private space where they slept and kept their personal belongings, the room was specifically used to store the parents’ firearms, and the purpose of the secure physical access to the room was to prevent other people, including defendant, from having access to the firearms; and the bedroom had a separate occupation from the rest of the house— defendant’s parents occupied the room exclusively, and only allowed defendant to enter the room at their discretion, when they were present.
The parties’ dispute reduces to a question of statutory interpretation: whether the parents’ locked bedroom is a separate unit, and therefore a separate building under ORS 164.205(l).3 “When a trial court’s denial of a defendant’s motion for a judgment of acquittal depends on *541its interpretation of the statute defining the offense, we review the trial court’s interpretation for legal error.” State v. Stewart, 282 Or App 845, 848, 386 P3d 688 (2016).
To determine the intent of the legislature, we first examine the text and context of the statute, followed by any legislative history provided by the parties, if it is useful to our analysis. State v. Gaines, 346 Or 160, 171-72, 206 P3d 1042 (2009). As noted, the definition of “building” in ORS 164.205(1) incorporates the “ordinary meaning” of “building,” and also states, in relevant part, “[w]here a building consists of separate units, including, but not limited to, separate apartments, offices or rented rooms, each unit is, in addition to being a part of such building, a separate building.” The ordinary meaning of “building” includes “a portion of a house occupied as a separate dwelling : APARTMENT, TENEMENT.” Webster’s Third New Int’l Dictionary 292 (unabridged ed 2002). Therefore, both the statutory definition and the ordinary meaning of the term “building” consider individual apartments and separately rented rooms to be separate buildings. Our case law is consistent with that interpretation. See, e.g., State v. Davis, 261 Or App 38, 48, 323 P3d 276 (2014) (office suite on second floor of multistory office building “had a use and physical identity distinct from the rest of the office building in which it was located and, therefore, fell within the statutory definition of a separate unit within a building”); State v. Handley, 116 Or App 591, 593-94, 843 P2d 456 (1992) (separate storage lockers in carport of apartment complex that were rented by different tenants were separate buildings for purposes of the burglary statute); State v. Barker/Phelps, 86 Or App 394, 398, 739 P2d 1045 (1987) (self-contained storage units in a commercial storage facility, which were rented separately, were each a separate building for purposes of the burglary statutes).
Here, there is no evidence that any of the rooms in the house, including the bedroom in question, were “rented rooms” or treated by the family as separate apartments. We agree with defendant that his parents’ bedroom is not a “separate unit,” a separate apartment, or a rented room.
In our previous decisions interpreting the statutory definition of “building” for purposes of the burglary statutes, *542we have focused our “separate unit” inquiry on “whether the area was self-contained from its parent building, including secure physical access, separate function, and separate occupation.” State v. Macon, 249 Or App 260, 264, 278 P3d 29, rev den, 352 Or 342 (2012). We also explained that a “unit” in the context of the burglary statute “refers to something that is ‘a constituent and isolable member of some more inclusive whole.’” Id. (quoting Webster’s at 2500). In other words, a separate unit is a component part that stands alone in its physical and functional occupancy.
In Macon, we affirmed the defendant’s conviction for second-degree burglary based on his theft of a lockbox from the storage room of a toy store, concluding that the storage room was a “separate unit” for purposes of the burglary statutes. We determined that the storage room of the toy store was a self-contained unit of the building that had a separate physical access through a camouflaged door, separate occupancy by employees only, and a separate function from the rest of the toy store—holding money and storage rather than selling goods. 249 Or App at 265. Viewing those characteristics in the light most favorable to the state, we concluded that the state had presented sufficient evidence “that the storage room was a ‘separate unit’ of the toy store and, therefore, a separate building for purposes of ORS 164.205(1).” Id. at 266.
However, not all distinct physical areas of a building qualify as separate units. In State v. Jenkins, 157 Or App 156, 158, 969 P2d 1048 (1998), the defendant entered a tavern and asked a tavern employee, who was behind the bar, for change. While the victim was at the cash register, defendant jumped over the bar, knocked the victim to the ground, yelled, “This is a robbery,” and then removed money from the cash register and fled. The defendant was charged with and convicted of first-degree burglary. On appeal, we reversed the defendant’s conviction, concluding that the area behind the bar in the tavern was not a separate unit within the larger structure of the tavern, and was therefore not a separate building under the statute. Id. at 160. Although we focused our inquiry on the question of physical access to the area in question, noting that it was “a relatively unsecured *543area once the building it occupies has been entered,” we also acknowledged that
“the function of the bar is encompassed by, and inseparable from, the purpose of the tavern. This is in marked contrast to complexes of self-contained units like apartment or office buildings where the ability to control access to individual units is discrete, and where the use of an individual unit is usually separate from the use of the units around it.”
Id.
Here, similar to the bar area in Jenkins, the parents’ bedroom had a function that was inseparable from the purpose of the house. The evidence established that the larger building in question was the house in which defendant and his parents lived together. The overall function of the house, then, was as a family residence. The parents’ bedroom functioned as a part of that residence; it was a bedroom that also happened to serve as the location in the home where defendant’s parents stored their firearms—specifically, in the closet where Mendez also kept his shoes.
The evidence also establishes that the occupation of the parents’ bedroom was not exclusive to defendant’s parents, as the state argues. The bedroom was primarily occupied by Mendez and Ferrer; however, defendant had permission to enter the bedroom at certain times, and the bedroom door was left open when Mendez was home.4
Lastly, the fact that the door to the parents’ bedroom had a deadbolt lock does not, by itself, turn the bedroom into a separate unit under ORS 164.205(1). Indeed, the state agrees that a locked door does not necessarily turn a bedroom into a “separate unit” of the house. Although secure physical access is one of the characteristics we consider in our inquiry, the lock on the door, here, did not change the nature or function of the bedroom so that it became a self-contained, separate unit from the rest of the house and, thus, a “separate building” under the burglary statutes.
*544The evidence, here, does not support a conclusion that the parents’ bedroom operated as a stand-alone, self-contained unit from the rest of the house. The trial court should have granted defendant’s motion for judgment of acquittal.
Conviction for first-degree burglary reversed; remanded for resentencing; otherwise affirmed.
Prior to the jury trial, defendant pleaded guilty to felon in possession of a firearm, ORS 166.270. He does not challenge that conviction on appeal.
Defendant raises two assignments of error. We reject defendant’s second assignment of error without further discussion.
We have not previously decided whether a bedroom in a house can be a “separate building” for purposes of the burglary statutes. That theory was raised in State v. Pena, 183 Or App 211, 51 P3d 646 (2002), but our conclusion to reverse the defendant’s first-degree burglary charge in that case was made on a different basis. In Pena, the defendant and three other people had leased a whole house together under one lease, and the defendant was accused of entering the bedroom of a cotenant with the intent to commit a crime therein. We stated, in dictum, that “whether a rented room is a separate building turns on, among other things, physical access, whether the unit is ‘self-contained,’ * * * and whether the units are individually rented.” Id. at 216 (internal citations omitted).
The state does not contend that defendant was a trespasser in his parents’ bedroom. See State v. Angelo, 282 Or App 403, 385 P3d 1092 (2016) (contractor who exceeded the spatial limitation on his license to be in a building was a trespasser and culpable for remaining unlawfully in that building under ORS 164.225(1)).